My and my friend are currently developing a web-based turn-based MMO strategy 
(you can check it out@ http://216.232.50.185/game/development/ - ii requires signing-up)
Anyway, I'm currently working on a message system. Here's a part of the code that gives me an error that I cant fix:
This is the error message I get:
Please, help
TESTING
[This message was edited by Toxic0n on March 27, 2002 at 16:42.]
(you can check it out@ http://216.232.50.185/game/development/ - ii requires signing-up)
Anyway, I'm currently working on a message system. Here's a part of the code that gives me an error that I cant fix:
Code:
<?
$s=@$QUERY_STRING;
$uID = @$HTTP_POST_VARS['userid'];
$mes = @$HTTP_POST_VARS['mes'];
$send = @$HTTP_POST_VARS['send'];
$mydate = date("F j, Y, g:i:s a");
include('getstatus.php');
include('getstats.php');
include('options.inc');
if ($banned==1 or $valid!=1){die("You are not allowed to access this page");}
if ($mes!=""){
if (!$result=@mysql_query("Select * from Players where PlayID=$uID")){
echo "Incorrect user ID";
exit();
}
echo "Sending message...";
if (strlen($mes)>200){
die("Your message cannot be longer than 200 chars");
}
$mes = htmlspecialchars($mes);
$mes = "<hr>". $mes;
if (!$result=mysql_query("insert into Messages(MTo, MFrom, Message, DateSent, Status, Type) values ($uID, $ID, \"$mes\", \"$mydate\", 1, \"User\"")){
echo "Error sending message :" . mysql_error();
}
else{echo "Message sent to user #$uID
";}
}
echo "
<html>
<head>
<title>Messages</title>
</head>
<body>
<a href=\"select.php?message\">Select user to send a message to</a>
<form method=\"post\" action=\"$PHP_SELF\">
User#<input type=\"text\" name=\"userid\" value=\"$s\">
Message: <input type=\"text\" name=\"mes\" value=\"\">
<input type=\"submit\">
<input type=\"HIDDEN\" name = \"Send\">
</form>
</body>
</html>
"
?>
I suspect it's one of those \" in the query but I can't get it to work.Sending message...Error sending message :You have an error in your SQL syntax near '' at line 1
Please, help
TESTING
[This message was edited by Toxic0n on March 27, 2002 at 16:42.]