PHP interesse |
|
Warning: eregi_replace(): REG_EPAREN in /home/webusers/llnraad/llnraad.spaceweb.be/toevoegen.php on line 30
Deze error krijg ik na iets te posten. Dit is het script. In het bericht dat ik poste stond een .
Lijn 30:
<?$bericht = eregi_replace("\[:'(\]","<img src=\"images/smileys/droevig.gif\">",$bericht);?>
<?$bericht = eregi_replace("\[:'(\]","<img src=\"images/smileys/droevig.gif\">",$bericht);? >
Misschien mag ' niet in
...ace("\:'(\]","<img sc...
...ace("\:'(\]","<img sc...
Volledig script:
<?PHP
include("config.php");
if($submit) {
mysql_connect("$host","$db_user","$db_psw");
mysql_select_db("$db_name");
$bericht = htmlspecialchars($bericht);
$bericht = nl2br($bericht);
$bericht = eregi_replace("\[:)\]","<img src=\"images/smileys/blij.gif\">",$bericht);
$bericht = eregi_replace("\[:S\]","<img src=\"images/smileys/verward.gif\">",$bericht);
$bericht = eregi_replace("\[8)\]","<img src=\"images/smileys/cool.gif\">",$bericht);
$bericht = eregi_replace("\[;)\]","<img src=\"images/smileys/knipoog.gif\">",$bericht);
$bericht = eregi_replace("\[:P\]","<img src=\"images/smileys/tong.gif\">",$bericht);
$bericht = eregi_replace("\[:D\]","<img src=\"images/smileys/tanden.gif\">",$bericht);
$bericht = eregi_replace("\[:O\]","<img src=\"images/smileys/omg.gif\">",$bericht);
$bericht = eregi_replace("\[:'(\]","<img src=\"images/smileys/droevig.gif\">",$bericht);
$datum = date("d/m/Y");
$tijd = date("H:i");
$insert = "INSERT INTO gastenboek (auteur,bericht,tijd,datum,email) VALUES ('$auteur','$bericht','$tijd','$datum','$email')";
$query = mysql_query($insert)or die(mysql_error());
echo "Je bericht is succesvol toegevoegd!<br><a href=\"index.php?p=gastenboek\">Klik hier</a> om het te bekijken";
}
else
{
echo "<table><form method=post>";
echo "<tr><td><b>Naam:</b></td><td><input type=text name=auteur></td></tr>";
echo "<tr><td><b>E-mail:</b></td><td><input type=text name=email></td></tr>";
echo "<tr><td><b>Berichtje:</b></td><td><textarea cols=50 rows=10 name=bericht></textarea></td></tr>";
echo "<tr><td><input type=submit name=submit value=Toevoegen></td><td><input type=reset name=reset value=Opnieuw></td></tr>";
echo "</form></table></p>";
echo "<p><a href=\"index.php?p=gastenboek\"><< Vorige</a>";
}
?>
<?PHP include("config.php"); if($submit) { $bericht = nl2br($bericht); $bericht = eregi_replace("\[:)\]","<img src=\"images/smileys/blij.gif\">",$bericht); $bericht = eregi_replace("\[:S\]","<img src=\"images/smileys/verward.gif\">",$bericht); $bericht = eregi_replace("\[8)\]","<img src=\"images/smileys/cool.gif\">",$bericht); $bericht = eregi_replace("\[;)\]","<img src=\"images/smileys/knipoog.gif\">",$bericht); $bericht = eregi_replace("\[:P\]","<img src=\"images/smileys/tong.gif\">",$bericht); $bericht = eregi_replace("\[:D\]","<img src=\"images/smileys/tanden.gif\">",$bericht); $bericht = eregi_replace("\[:O\]","<img src=\"images/smileys/omg.gif\">",$bericht); $bericht = eregi_replace("\[:'(\]","<img src=\"images/smileys/droevig.gif\">",$bericht); $insert = "INSERT INTO gastenboek (auteur,bericht,tijd,datum,email) VALUES ('$auteur','$bericht','$tijd','$datum','$email')"; echo "Je bericht is succesvol toegevoegd!<br><a href=\"index.php?p=gastenboek\">Klik hier</a> om het te bekijken"; } else { echo "<table><form method=post>"; echo "<tr><td><b>Naam:</b></td><td><input type=text name=auteur></td></tr>"; echo "<tr><td><b>E-mail:</b></td><td><input type=text name=email></td></tr>"; echo "<tr><td><b>Berichtje:</b></td><td><textarea cols=50 rows=10 name=bericht></textarea></td></tr>"; echo "<tr><td><input type=submit name=submit value=Toevoegen></td><td><input type=reset name=reset value=Opnieuw></td></tr>"; echo "</form></table></p>"; echo "<p><a href=\"index.php?p=gastenboek\"><< Vorige</a>"; } ?>
|