Hoi.
Ik heb deze script;
(@ PHPHulp)
Alleen nu moet er nog een database aangemaakt worden, en de structuur enzo. Zou iemand die voor mij willen maken? Ik heb zelf al geprobeerd maar ik weet niet welke ik moet invullen
het moeten 3 tabbelen zijn.
berichten - datum - ip
alvast bedankty
Ik heb deze script;
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// Kijken of er gepost is[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #FF8000]// Controleren of het bericht is ingevuld[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen bericht ingevuld![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]// Query maken en invoegen[/COLOR]
[COLOR= #0000BB]$sQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"
INSERT INTO berichten
(
bericht,
datum
)
VALUES
(
"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]",
NOW()
)
"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$qSql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sQuery[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$qSql[/COLOR] [COLOR= #007700]===[/COLOR] false[COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er gaat iets fout tijdens het invoegen![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bericht is toegevoegd![/COLOR][COLOR= #007700];
}
}
}[/COLOR]
[COLOR= #FF8000]// Form op het scherm tonen[/COLOR]
?>
<form method="post" action=""><p>
Bericht: <input type="text" name="bericht" /><br />
<input type="submit" value="Versturen" />
</p></form> (@ PHPHulp)
Alleen nu moet er nog een database aangemaakt worden, en de structuur enzo. Zou iemand die voor mij willen maken? Ik heb zelf al geprobeerd maar ik weet niet welke ik moet invullen
het moeten 3 tabbelen zijn.
berichten - datum - ip
alvast bedankty

