S
Stefy
Guest
seems very simple.
you make a post form with subj and message
1.
$to = mysql_result(mysql_query('SELECT `name` FROM `users` WHERE `id`=\''.$_GET['id'].'\''),0);
of course you take all the security measures(like if id is set and if id actually exists. To check if it exists you select id from users and use mysql_num_rows. If the result of mysql_num_rows is bigger than >0, it means there is actually a person with that id).
$from = $_SESSION['name'];
$subj = mysql_real_escape_string($_POST['subject']) (check if post is is not empty)
$msg = same as above $_POST['message']
than all you need is an insert
mysql_query("INSERT INTO `inbox` (`username`,`to`,`subject`,`message`) VALUES (\'".$from."\',\'".$to."\',\'".$subject."\',\'".$message."\'");
what's so tough about it?
you make a post form with subj and message
1.
$to = mysql_result(mysql_query('SELECT `name` FROM `users` WHERE `id`=\''.$_GET['id'].'\''),0);
of course you take all the security measures(like if id is set and if id actually exists. To check if it exists you select id from users and use mysql_num_rows. If the result of mysql_num_rows is bigger than >0, it means there is actually a person with that id).
$from = $_SESSION['name'];
$subj = mysql_real_escape_string($_POST['subject']) (check if post is is not empty)
$msg = same as above $_POST['message']
than all you need is an insert
mysql_query("INSERT INTO `inbox` (`username`,`to`,`subject`,`message`) VALUES (\'".$from."\',\'".$to."\',\'".$subject."\',\'".$message."\'");
what's so tough about it?