I have this page that collects user info, if info is submitted then go to another page afterward. Else show the same page until data is submitted.
for example.
you fill out an application. if ur application was successfull, you will be shown the home page. Else, keep showing the application until it is successful.
in my membership code:
function user_register() {
Theres more codes before this..
$query = "INSERT INTO Customer (customer_id, cust_address, gen_city, generalacct_state_country, gen_zip, home_phone, date_created)
VALUE('$user_id', '$cust_address', '$gen_city', '$generalacct_state_country', '$gen_zip', '$home_phone', now())";
$result = mysql_query($query) or die("<BR>Invalid query: " . mysql_error());
if (!$result) {
$feedback = 'ERROR - Database error';
return $feedback;
}
return 1;
}
$feedback = 'YOU HAVE SUCCESSFULLY REGISTERED. WELCOME!';
return $feedback;
}
$feedback = 'ERROR - Telephone number is invalid! <br />';
return $feedback;
}
}
then on my page of showing the application.
require_once('membership_process.php');
if ($_POST['submit'] == 'submit') {
if (strlen($_POST['home_phone']) <= 21 && strlen($_POST['business_phone']) <=21) {
$feedback = user_register();
} else {
$feedback = 'ERROR - Telephone number is invalid! <br />';
}
if ($feedback == 1) {
// Register the input with the value
$_SESSION['user_name'] = $_POST['user_name'];
session_register("authr_user_name");
$authr_user_name = $_POST['user_name'];
// On successful login, redirect to homepage, for now, i'm gonna redirect it to the homepage!!!!!!!!!!!!!!!!
header("Location: URL=http://www.yourcompany.com/memberpage/index.php");[/URL]
} else {
$feedback_str = "<P class=\"errormess\">$feedback</P>";
}
} else {
$feedback_str = '';
}
somehow my header("location: is mess up when i show it in this code...i know there's a way to fix it so that it looks normal. anyways, can anyone help me with my code besides it doens't look good with the header...i want my page to redirect to my index.php.
i tried to fix it and i did fix it once, but the url of index.php was no longer index.php, it was the url of my application. it did redirect, but it kept the url of my appliacation. besides that point. i know my code is wrong...some how...i want it to automatically show my index.php when a successful application is submitted...[