Tutorials
Allow duplicate emails
-
Allow duplicate emails
Posted on November 29, 2004
Written by
Julie (view more by Julie)
Comments (0)
Filed under Scripts: PHPFanBase, Tutorials
This brief tutorial will show you how to allow members to join with duplicate emails.
Open join.php and find the following lines of code (if you haven’t edited anything, they should start at line 316):
if ($num == "0"){
if ($emailnotify == 'Y'){
$msg = "Name:\t$_POST[name]\n";
$msg .= "E-Mail:\t$_POST[email]\n";
$msg .= "Hide E-Mail:\t$_POST[hideemail]\n";
$msg .= "URL:\t$_POST[url]\n";
$msg .= "Country:\t$_POST[country]\n";
if ($enablefave == 'Y'){
$msg .= "Fave:\t$_POST[fave]\n"; }
$msg .= "Comments:\t$_POST[comments]\n";
$msg .= "Sender IP:\t$REMOTE_ADDR\n";
$msg .= "\nLogin to your Admin Panel: $siteurl/admin.php\n";
$recipient = "$adminemail";
$subject = "Member - $sitename";
$mailheaders = "From: $_POST[email]\n";
$mailheaders .= "Reply-To: $_POST[email]\n\n";
mail($recipient, $subject, $msg, $mailheaders); }
if ($enablefave == 'Y'){
$query = "INSERT INTO $table VALUES ('','$name','$email','$url','$country','$comments','$hideemail','$apr','$fave')";
mysql_query($query);
} else {
$query = "INSERT INTO $table VALUES ('','$name','$email','$url','$country','$comments','$hideemail','$apr')";
mysql_query($query);
}
echo "<p>Thank you, $_POST[name]! You will be added to the members list with the next update. :)</p>";
} else { ?>
<p>Sorry, but this email address is already listed in the database. This means that you're already listed as a member. If you wish to update your member information, please use the <a href="join.php?action=update">Update Form</a>. If you want to see your listing as a member, please <a href="members.php">click here</a>.</p>
<? } }
Delete those lines and replace them with this code:
if ($emailnotify == 'Y'){
$msg = "Name:\t$_POST[name]\n";
$msg .= "E-Mail:\t$_POST[email]\n";
$msg .= "Hide E-Mail:\t$_POST[hideemail]\n";
$msg .= "URL:\t$_POST[url]\n";
$msg .= "Country:\t$_POST[country]\n";
if ($enablefave == 'Y'){
$msg .= "Fave:\t$_POST[fave]\n"; }
$msg .= "Comments:\t$_POST[comments]\n";
$msg .= "Sender IP:\t$REMOTE_ADDR\n";
$msg .= "\nLogin to your Admin Panel: $siteurl/admin.php\n";
$recipient = $adminemail;
$subject = "Member - $sitename";
$mailheaders = "From: $_POST[email]\n";
$mailheaders .= "Reply-To: $_POST[email]\n\n";
mail($recipient, $subject, $msg, $mailheaders); }
if ($enablefave == 'Y'){
$query = "INSERT INTO $table VALUES ('','$name','$email','$url','$country','$comments','$hideemail','$apr','$fave')";
mysql_query($query);
} else {
$query = "INSERT INTO $table VALUES ('','$name','$email','$url','$country','$comments','$hideemail','$apr')";
mysql_query($query);
}
echo "<p>Thank you, $_POST[name]! You will be added to the members list with the next update. :)</p>";
}
That’s it! Just save and re-upload the file. Now members are able to join more than once with the same email, which can come in handy if you are using the script for something other than a fanlisting.
Comments
Comments are closed for this entry.