Sorry that was a crap explanation - try again,
a user clicks a link which contains a URL like
http://www.mysite.com/send_message?user_id=12345
i then use the $_GET variable to get the user id from the URL so i can send the message to the right person - like:
The send_message page contains a form to send a message... simply a textarea. When the form is submitted i need to add the message to the database relating to that user id:
Code: Select all
if(isset($_POST['my_variable'])){
//insert values into database
mysql_query("INSERT INTO `users`(`send_to_user_id`, `message`) VALUES ('{$user_id}', '{$_POST['message']}')") or die(mysql_error());
}
i know i've got the whole GET/POST mucked up here, but i'm unsure of a solution. I don't want to pass a message through the URL as it's not secure, but i'm unsure of how to pass the user id across to send to, and then submit a form using post to add the data to the database.
When you submit the form it clears everything in the url after "?" which leaves my $user_id undefined.
Yes - i've got myself into a bit of a mess, but i'm unsure of how to do it.
Thanks