I am new to PHP...I just need to modify this script so it will NOT check for Email duplicates and if Email duplicates are found for it to be ignores...in other words...I don't care if two of the same email addresses are submitted.
Here's a part of the page:
<?php
switch( $task ) {
case "Register": // insert or update the database
/*
This page is called on submit of the registerUnifiedForm.php where a presumably
new customer completes their contact data. This script inserts that data
into the db, including a brand new category listing. Everything is done
in this one step to help the customer along... If they want to change something
or add more listings, then they need to log in ...
First this script checks to see if a match exists for the email and password,
since we don't want any duplicates, and if a match exists then we make an update
to the database with the new information, instead of making an insert.
This lets an unwitting customer keep their original ID [$customerid] and
still lets them make changes to the database even in so-called 'Register' mode.
*/
// check to see if the password matches the password confirm
$password = $REQUEST['password'];
$confirmPassword = $REQUEST['confirmPassword'];
if($confirmPassword != $password) {
$password = "";
echo "<p>Password and confirming password do not match. Please enter them again.</p>";
include_once("header.php");
include("register.php");
exit;
}
// first make sure the email is not a duplicate
$query = "SELECT count(email) AS 'EmailDuplicates' FROM " . TABLECUSTOMER . " WHERE email = '$email'";
// pconnect, select and query
if ($link_identifier = mysql_pconnect(DBSERVERHOST, DBUSERNAME, DBPASSWORD)) {
if ( mysql_select_db(DBNAME, $link_identifier)) {
// run the query
$queryResultHandle = mysql_query($query, $link_identifier) or die( mysql_error() );
$EmailDuplicates = mysql_result($queryResultHandle,0);
/
if more than one email address exists say it is already used
and offer the password lookup form
/
switch($EmailDuplicates) {
case 0:
/
this is the expected result. No duplicate should be found.
We gracefully break out of this switch and continue processing.
/
break;
case 1:
default:
/
Bad news. If 1 or more (default covers more) accounts exist
with the same email address, then don't let this happen,
and redirect the user to choices, including looking up their password.
/
echo"<script language=\"Javascript\" type=\"text/javascript\" src=%22yellow.js/%22></script>";
echo"<script language=\"Javascript\" type=\"text/javascript\">loadCSSFile();</script>";
include("header.php");
echo"<TABLE width=729 align=\"center\" cellpadding=0 cellspacing=0><tr><td>";
echo "\n<h2>Problem! $email already exists</h2>";
echo"<p>The email address $email already exists. Each account MUST have a unique email address.</p>";
echo"\n<h3>Your Choices</h3>";
echo "<ul><li><a href=%22password.php/%22>look up your password,</a> or</li><li>
<a href=%22%22 . LOGINPAGE . "\">go to the login page and enter the correct password</a> or</li><li>
<a href=%22register.php/%22>register using a different email</a> which will create a new account</li></ul>";
echo"\n<h3>Recommendation</h3>";
echo"<p>We recommend leaving the 'Remember Me' checkbox as CHECKED. This causes your login details to be remembered the next time you log in.</p>";
echo"<p>Example: <form>
<input type='checkbox' name='foo' CHECKED value="ON">
<a href=%22help.php#remember/">Remember me</a></form></p></td></tr></table>";
exit;
} // switch($EmailDuplicates
/* at this point we know there are no duplicate email addresses
because we exited to the login page if there were.
Now check the password.