Posted by Hyshiro Thu 1st Mar 2007 17:41 - Syntax is JavaScript - 30 views
Modification of posting from Hyshiro Thu 1st Mar 2007 17:30
Download | New Post | Modify | Diff | Diff | Hide line numbers
Modification of posting from Hyshiro Thu 1st Mar 2007 17:30
Download | New Post | Modify | Diff | Diff | Hide line numbers
Description:
Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in
/home/hyshiro/public_html/login_form.inc on line 125
Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in
/home/hyshiro/public_html/login_form.inc on line 125
-
/* Program: login.php* Desc: Login program for the Members Only section of the pet store.* It provides two options: (1) login using an existing login name and* (2) enter a new login name. Login names and passwords are stored in mysql*/session_start ();include("conf.inc");switch (@$_GET['do']){case "login";$connection = mysql_connect($host, $user, $password)or die ("Couldn't connect to server.");$db = mysql_select_db($database, $connection)or die ("Couldn't select database.");$sql = "SELECT loginName FROM MemberWHERE loginName='$_POST[fusername]'";$result = mysql_query($sql)or die("Couldn't execute querry.");$num = mysql_num_rows($result);if ($num == 1) // login name was found{$sql = "SELECT loginName FROM MemberWHERE loginName='$_POST[fusername]'AND password=md5('$_POST[fpassword]')";$result2 = mysql_query($sql)or die("Couldnt execute query 2.");$num2 = mysql_num_rows($result2);if ($num2 > 0) // password is correct{$_SESSION['auth']="yes";$logname=$_POST['fusername'];$_SESSION['logname'] = $logname;$today = date("Y-m-d h:m:s");$sql = "INSERT INTO Login (loginName,loginTime)VALUES ('$logname','$today')";mysql_query($sql) or die ("Can't execute query.");header("Location: Member_page.php");}else // password is not correct{unset($_GET['do']);$message="The Login Name, '$_POST[fusername]'exists, but you have not entered the correct password, Please tryagain.
";include("login_form.inc");}}elseif ($num == 0) // login name not found{unset($_GET['do']);$message = "The Login Name you entered does not exist!Please try again.
";include("login_form.inc");}break;case "new";foreach($_POST as $field => $value){if ($field != "fax"){if ($value == ""){unset($_GET['do']);$message_new = "Required information is missing.Please try again.";include("login_form.inc");exit();}}if (ereg("(Name)",$field)){if (!ereg("^[A-Za-z' -]{1,50}$",$value)){unset($_GET['do']);$message_new = "$field is not a valid name.Please try again.";include('login_form.inc');exit();}}$$field = strip_tags(trim($value));} // end foreachif (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$zip)){unset($_GET['do']);$message_new = "$zip is not a valid phone number.Please try again.";include("login_form.inc");exit();}if (!ereg("^[0-9)(xX -]{7,20}$",$phone)){unset($_GET['do']);$message_new = "$phone is not a valid phone number.Please try again.";include("login_form.inc");exit();}if ($fax != ""){if (!ereg("^[0-9)(xX -]{7,20}$",$fax)){unset($_GET['do']);$message_new = "$fax is not a valid phone number.Please try again.";include("login_form.inc");exit();}}if (!ereg("^.+@.+\\..+$",$email)){unset($_GET['do']);$message_new = "$email is not a valid email address.Please try again.";include("login_form.inc");exit();}/* check to see if login name already exists */$connection = mysql_connect($host,$user,$password)or die ("Couldn't connect to server.");$db = mysql_select_db($database, $connection)or die ("Couldn't select database.");$sql = "SELECT loginName FROM MemberWHERE loginName='$newname'";$result = mysql_query($sql)or die("Couldn't execute query.");$num = mysql_numrows($result);if ($num > 0){unset($_GET['do']);$message_new = "$newname already used.Select another Member ID.";include("login_form.inc");exit();}else{$today = date("Y-m-d");$sql = "INSERT INTO Member (loginName,createDate,password,firstName,lastName,street,city,state,zip,phone,fax,email) VALUES('$newname','$today',md5('$newpass'),'$firstName','$lastName','$street','$city','$state','$zip','$phone','$fax','$email')";mysql_query($sql);$_SESSION['auth']="yes";$_SESSION['logname'] = $newname;/* send email to new member */$emess = "A new Member Account has been setup. ";$emess = "Your new Member ID and password are: ";$emess = "\n\n\t$newname\n\t$newpass\n\n";$emess = "We appreciate your interest BCSO";$emess = " at www.bcso.co.uk! \n\n";$emess = "If you have any questions or problems,";$emess = " email ";$ehead="From: ";$subj = "Your new Member Account from BCSO";$mailsend=mail("$email","$subj","$emess","$ehead");header("Location: New_member.php");}break;default;include("login_form.inc");}?>
PermaLink to this entry https://pastebin.co.uk/11242
The following amendments have been posted:
-
Anonymous (Thu 1st Mar 2007 17:43)
Posted by Hyshiro Thu 1st Mar 2007 17:41 - Syntax is JavaScript - 30 views
Modification of posting from Hyshiro Thu 1st Mar 2007 17:30
Download | New Post | Modify | Diff | Diff | Hide line numbers
Modification of posting from Hyshiro Thu 1st Mar 2007 17:30
Download | New Post | Modify | Diff | Diff | Hide line numbers
Comments: 0