loading pages using php?
Posted: Fri Nov 07, 2003 3:41 am
Hi there,
I'm quite new to php, but i'm working on a quite complex registration script. It works fine, and will add users/encrypted passwords/e-mail addresses to a database etc. But after it has done that i want it to load a different page that says successfull registration. The form is on the same page as the validation script, and works using:
$_SERVER['PHP_SELF]
The idea is that when the form is submitted it then reloads the page, validates the values of each field and does one of two things - displays an error message if the fields have bad values, or submits the data to the databse if the values are correct. Here is a the last bit of the validation/data submital script:
//if all the values are correct with no errors the following script is run:
$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 {
After else I'm looking for a line to put that will load up a page called success.php. Does anybody know how to do this without using headers? Thanks a lot in advance...
james moore
I'm quite new to php, but i'm working on a quite complex registration script. It works fine, and will add users/encrypted passwords/e-mail addresses to a database etc. But after it has done that i want it to load a different page that says successfull registration. The form is on the same page as the validation script, and works using:
$_SERVER['PHP_SELF]
The idea is that when the form is submitted it then reloads the page, validates the values of each field and does one of two things - displays an error message if the fields have bad values, or submits the data to the databse if the values are correct. Here is a the last bit of the validation/data submital script:
//if all the values are correct with no errors the following script is run:
$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 {
After else I'm looking for a line to put that will load up a page called success.php. Does anybody know how to do this without using headers? Thanks a lot in advance...
james moore