PHP interesse |
|
Hallo,
Ik zit met een vervelende error, die ik maar niet weg krijg. Weet iemand wat ik fout doe ??? (dood = die alleen doet hij niet exit)
<?php
include 'inc_connect_mysql.php';
include 'inc_logged_in.php';
include 'overall_header.php';
$user_id = intval($_SESSION['id']);
if(isset($_POST['submit']) && $_POST['bericht']!='')
{
if (strlen($_POST['bericht']) > 30 ) {
dood('Uw bericht mag maximum 30 tekens bevatten!');
}
while($row = mysql_fetch_array($result)){
if($leden['username'] == $row['user_id']){
dood('U heeft vandaag al gepsot');
}
else{
$lid = "SELECT * FROM bnc_users WHERE user_id = '".$user_id."'";
$leden_query = mysql_query($lid) or dood(mysql_error());
$leden = mysql_fetch_assoc($leden_query);
$naam = $leden['username'];
$user_id = intval($_SESSION['id']);
$bericht = htmlspecialchars($reactie);
$bericht = mysql_real_escape_string($_POST['bericht']);
$ip = $_SERVER['REMOTE_ADDR'];
$sql="INSERT INTO blog_shoutbar (user_idnaam,bericht,ip) VALUES ('".$user_id."','".$naam."','".$bericht."','".$ip."')";
$sql = mysql_query($sql) or die(mysql_error());
echo'<a href="/index.php">Bekijk bericht</a>' . "\n";
}
else{
echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo 'Reactie : <br/><input size="50" maxlenght="50" name="bericht" type="text"><br/><br/>' . "\n";
echo '<input type="submit" name="submit" value="Post bericht"><br/>' . "\n";
}
}
include 'overall_footer.php';
?>
<?php include 'inc_connect_mysql.php'; include 'inc_logged_in.php'; include 'overall_header.php'; $user_id = intval($_SESSION['id']); if(isset($_POST['submit']) && $_POST['bericht']!='') { if (strlen($_POST['bericht']) > 30 ) { dood('Uw bericht mag maximum 30 tekens bevatten!'); } if($leden['username'] == $row['user_id']){ dood('U heeft vandaag al gepsot'); } else{ $lid = "SELECT * FROM bnc_users WHERE user_id = '".$user_id."'"; $naam = $leden['username']; $user_id = intval($_SESSION['id']); $ip = $_SERVER['REMOTE_ADDR']; $sql="INSERT INTO blog_shoutbar (user_idnaam,bericht,ip) VALUES ('".$user_id."','".$naam."','".$bericht."','".$ip."')"; echo'<a href="/index.php">Bekijk bericht</a>' . "\n"; } else{ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo 'Reactie : <br/><input size="50" maxlenght="50" name="bericht" type="text"><br/><br/>' . "\n"; echo '<input type="submit" name="submit" value="Post bericht"><br/>' . "\n"; } } include 'overall_footer.php'; ?>
Alvast bedankt.
|