Help with Registration Page
Hello Support,
I am using SA and generated the following:
registration page, login page, Email Password page, Profile and logout page.
Uploaded the pages and tested the registration page by completing the necessary information and after I clicked submit button, I was redirected to HTTP 404 Webpage cannot be found.
I was expecting to be redirected to the login page. Any help? I appreciate your kind effort
<?php require_once('../Connections/Roseshuttle.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
$MM_dupKeyRedirect="../account/failed.php";
$loginUsername = $_POST['EmailAddress'];
$LoginRS__query = "SELECT EmailAddress FROM user WHERE EmailAddress='" . $loginUsername . "'";
mysql_select_db($database_Roseshuttle, $Roseshuttle);
$LoginRS=mysql_query($LoginRS__query, $Roseshuttle) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
//if there is a row in the database, the username was found - can not add the requested username
if($loginFoundUser){
$MM_qsChar = "?";
//append the username to the redirect page
if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
$MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar ."requsername=".$loginUsername;
header ("Location: $MM_dupKeyRedirect");
exit;
}
}
?>
<?php
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
?>
<?php
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "WAATKRegistrationForm")) {
$insertSQL = sprintf("INSERT INTO user (UserName, Password, ConfirmPassword, FirstName, LastName, PhoneNumber, StreetAddress, City, State, Zipcode) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['UserName'], "text"), GetSQLValueString($_POST['Password'], "text"), GetSQLValueString($_POST['ConfirmPassword'], "text"), GetSQLValueString($_POST['FirstName'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['PhoneNumber'], "text"), GetSQLValueString($_POST['StreetAddress'], "text"), GetSQLValueString($_POST['City'], "text"), GetSQLValueString($_POST['State'], "text"), GetSQLValueString($_POST['Zipcode'], "text"));
mysql_select_db($database_Roseshuttle, $Roseshuttle);
$Result1 = mysql_query($insertSQL, $Roseshuttle) or die(mysql_error());
$insertGoTo = "../account/user_LogIn.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>