Page 1 of 1

using javascript and post?

Posted: Fri Nov 07, 2003 3:32 pm
by shadow_blade47
hi there. I've made a script that when it's success full it redirects the user to a success page. I'd like to display some information on that page such as username/e-mail and race and classes (its an mmorpg). Here is the code:

$query = "INSERT INTO user (user_id, user_name, first_name, last_name, password, email, remote_addr, date_created)
VALUES (NULL, '$User_name', '$First_name', '$Last_name', '$password', '$Email1', '$user_ip', NOW())";
$result = mysql_query($query);
if (!$result) {
$feedback = 'ERROR - MySQL has encountered a technical failure - contact the administrator,';
return $feedback;
} else {
echo "<script language=\"javascript\">";
echo "document.location='success.php'";
echo "</script>";

after the else part i was wondering what i should put to pass on information from this page to the next. The variables have already been set on this page but is there a way of carrying them through to the next page whilst still redirecting the browser using javascript? cheers

Posted: Fri Nov 07, 2003 3:44 pm
by d3ad1ysp0rk
i dont believe so.. thats why i would've not even had a "success" page, and instead put whatever you wanted to say in your

Code: Select all

&#125; else &#123; 
echo "<script language="javascript">"; 
echo "document.location='success.php'"; 
echo "</script>";
part.. that way the variables would be there

you could always add session variables.. (either just their ID, and call the rest of the stuff on success.php using their ID, or all the variables)