ok i fixed that part.. now i have another error.. ggrr...
the error is in the from part of the script...
this is the error that i get..
You have an error in your SQL syntax near 'from, username, memo, date) VALUES ('xlordt', 'digitalx', 'sup supppp' at line 1
and here is part of my fixed code...
if ((($submit) || ($_POST['username']) || ($_POST['memo']))){
$_FROM = $_USER['username'];
$date = date("D dS M,Y h:i a");
$sql = "INSERT INTO gl_memo(from, username, memo, date) VALUES ('$_FROM', '$username',
'$_POST[memo]', '$date')";
$result = mysql_query($sql) or die(mysql_error());
echo "<br><br><br> Memo Sent to " . $username;
}else{
// Select users from db
$result = "SELECT * FROM users";
$sql = mysql_query($result) or die(mysql_error());
WHILE ($row = mysql_fetch_array($sql)){
$username = $row['username'];
$option_block .= "<option name=\"username\"> ". $row['username'] . "</option>";
}
// Show Form
echo '<BR><BR><FORM METHOD="POST" ACTION=' . $PHP_SELF . '>
<TABLE WIDTH=55% align=center><TR><TD><br>
From: <b>' . $_FROM . '</b><br>
Select user: <br>
<SELECT NAME="username"><br> ' .
$option_block . '<br>
</SELECT><BR><br>
Messege: <br>
<TEXTAREA ROWS=8 COLS=65 NAME="memo"></TEXTAREA><br>
<INPUT TYPE="submit" NAME="submit" ALT="submit" value="submit memo">
</FORM></TD></TR></TABLE>
';
?>
now .. if i was to take out.. from then it will work.. but how will a user know where the memo came from.. how can i fix. this.. thanx =( btw.. thanx for the fast replay