Nieuw lid |
|
nuja geeft zoals jullie ondertussen gewoon zijn bij mij geen parse error ofzo. Maar ja ik vind het toch weer niet waarom hij niet wilt toevoegen
<?php ob_start(); ?>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<?php
include('dbconnect.php');
$naam = $_POST['name'];
$email = $_POST['email'];
$msg = $_POST['message'];
$ws = $_POST['website'];
$check_email = "/^([a-z0-9_-]+.)*?[a-z0-9_-]+@([a-z0-9-_]{2,}).[a-z0-9-_]*(.[a-z0-9- _]{2,})*$/i";
$zend = $_POST['ok'];
$teller;
if($zend)
{
if(!preg_match($check_mail, $email))
{
echo "your emailadress seems to be invalid";
}
else if($naam == "")
{
echo "you MUST fill in a name! <br>";
}
else if($msg == "")
{
echo "You forgot to write a message";
}
else
{
$addquery = mysql_query("INSERT INTO gastenbook (`naam`, `bericht`, `email`, `website`, `post_date`)
VALUES ('$naam','$msg','$email','$ws',NOW())");
if($addquery)
{
echo "thanks for your message";
echo "redirecting";
echo "<a href=\"guestbook.php\" target=\"_self\">go right back to the guestbook<\a>";
do{
$i++;
}while($i < 500);
header("Location: guestbook.php");
}
}
}else
{
?>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<p>your name: <br>
<input type="text" name="name" size="30">
<br>
<br>
your email: <br>
<input type="text" name="email" size="30">
<br>
<br>
message:<br>
<textarea name="message" cols="50" rows="5"></textarea>
<br>
<br>
website: <strong><br>
http://
<input name="website" type="text" size="50">
</strong></p>
<input type="submit" name"ok" value="send">
</form>
<?php
}
?>
</td>
</tr>
</table>
<table width="300" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <?php include('dbconnect.php'); $naam = $_POST['name']; $email = $_POST['email']; $msg = $_POST['message']; $ws = $_POST['website']; $check_email = "/^([a-z0-9_-]+.)*?[a-z0-9_-]+@([a-z0-9-_]{2,}).[a-z0-9-_]*(.[a-z0-9- _]{2,})*$/i"; $zend = $_POST['ok']; $teller; if($zend) { { echo "your emailadress seems to be invalid"; } else if($naam == "") { echo "you MUST fill in a name! <br>"; } else if($msg == "") { echo "You forgot to write a message"; } else { $addquery = mysql_query("INSERT INTO gastenbook (`naam`, `bericht`, `email`, `website`, `post_date`) VALUES ('$naam','$msg','$email','$ws',NOW())"); if($addquery) { echo "thanks for your message"; echo "<a href=\"guestbook.php\" target=\"_self\">go right back to the guestbook<\a>"; do{ $i++; }while($i < 500); header("Location: guestbook.php"); } } }else { ?> <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post"> <p>your name: <br> <input type="text" name="name" size="30"> <br> <br> your email: <br> <input type="text" name="email" size="30"> <br> <br> message:<br> <textarea name="message" cols="50" rows="5"></textarea> <br> <br> website: <strong><br> http:// <input name="website" type="text" size="50"> </strong></p> <input type="submit" name"ok" value="send"> </form> <?php } ?> </td> </tr> </table>
alvast bedankt
greetz,
J.
|