Help! [PHP]

Gestart doorSebastiaanh4 reacties60 weergaven

5 berichten · pagina 1 van 1

Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,
Ik kamp op dit moment met een probleem in mijn script.
Hij plaatst het namelijk niet in de database.
Mijn code:

[COLOR= #0000BB]<?php[/COLOR]
  [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]

  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])) {[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]<div id="container">[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]Uw bericht is verzonden naar [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$bFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]snaam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];[/COLOR]
     [COLOR= #0000BB]$aQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO contact (aemail, onderwerp, bericht, ip)
                  VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aemail[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]onderwerp[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/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]<div id="container">[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]<form action="#" method="post">[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]Uw email: <br />[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]<input type="text" name="aemail"><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]Onderwerp: <br />[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]<input type="text" name="onderwerp"><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]Bericht: <br />[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]<textarea name="bericht"></textarea><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]<input type="submit" name="submit" value="Verstuur">[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];
  }[/COLOR]
?>

[COLOR= #0000BB]<?php[/COLOR]

  onder[COLOR= #007700]();[/COLOR]

?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
$aQuery = mysql_query("INSERT INTO contact (aemail, onderwerp, bericht, ip)
                  VALUES (".mysql_real_escape_string($_POST[aemail]).", ".mysql_real_escape_string($_POST[onderwerp]).", ".mysql_real_escape_string($_POST[bericht]).", ".mysql_real_escape_string($_SERVER[REMOTE_ADDR]).")") or die(mysql_error());
0
Sebastiaanh

Lid · Topicstarter

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ah, heb het al gefixt yes_newWas een a vergeten voor ip, moest aip zijn ipv ip
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Dat kan je dus zien als je achter je query dit neer zet:
or die(mysql_error());
wink
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Slotje op verzoek van TS
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren