I’ve tried using mail() on it’s own and it only sends the mail once but in this script it sends it out twice. Could it be something to do with headers or sessions? I’m calling this script by
[code=php]header(“location: registerc.php”);
registerc.php:
[code=php]
<? session_start();
include(“connect.php”);
$p_result = mysql_query(“SELECT * FROM personal_details WHERE userid=’$user'”);
$p_row = mysql_fetch_row($p_result);
$l_result = mysql_query(“SELECT * FROM login WHERE userid=’$user'”);
$l_row = mysql_fetch_row($l_result);
include(“header.php”);
include(“tab3.php”);
$nav_title=”Open An Account”;
include(“navbar.php”);
?>
<div class=”progressbar”>
<div style=”float:left; margin-right:20px;”>1. Enter Information</div>
<div style=”float:left; margin-right:20px;”><b>2. Verify Information</b></div>
<div style=”float:left; margin-right:20px;”>3. Check Email</div>
</div>
<div class=”content”>
<h1>Verify Information</h1>
<div class=”divider”></div>
<?
$body = “Hello $p_row[1] $p_row[2], nn”;
$body .= “Click the link below to activate your Auction.Beta account: nn”;
$body .= “http://www.argyllnewmedia.co.uk/auction/validate.php?u=$l_row[0]&v=$l_row[3] nn”;
$body .= “If you’re unable to click the link above, cut and paste it into your web browser. nn”;
$body .= “Should you forget your password, you can request a new one which will be sent to this email address. nn”;
$body .= “Thank you for registering. nnn”;
$body .= “Auction.Beta Team nn”;
$from = “[email protected]”;
$mailheader = “From: $fromrn”;
mail(“$l_row[2]”,”Auction.Beta Registration”,”$body”,”$mailheader”);
echo “We just sent an email to <b>$l_row[2]</b> to verify your registration. It contains a link you’ll need to
follow to confirm your email address. Please check your email now.<br><br>”;
?>
<p>If you do not receive the message in the next 10 minutes, you can <b>
<a class=”bluelink” href=”registerc.php”>request another verification email.</a></b></p>
<p>If you’ve been waiting for over 15 minutes:
<ol>
<li>Make sure you have entered the correct email address</li>
<li>Make sure your spam filter allows email from “[email protected]”</li>
<li>Request the verification email again</li>
</ol></p>
<p>For your records, here are your account details:</p>
<div class=”inner_content”>
<div class=”mailing”><b>Address</b><br><? echo “$p_row[1] $p_row[2]”; ?></div>
<div class=”mailing”><? echo $p_row[3]; ?></div>
<div class=”mailing”><? echo $p_row[4]; ?></div>
<div class=”mailing”><? echo $p_row[5]; ?></div>
<div class=”mailing”><? echo $p_row[6]; ?></div>
<div class=”mailing”><? echo $p_row[7]; ?></div>
<div class=”mailing”><br><b>User Name</b><br><? echo $l_row[0]; ?></div>
<div class=”mailing”><br><b>Password</b><br><? echo $l_row[1]; ?></div>
<div class=”mailing”><br><b>Sectret Question</b><br><? echo $l_row[4]; ?></div>
<div class=”mailing”><br><b>Sectret Answer</b><br><? echo $l_row[5]; ?></div>
</div>
</div>
<? include(“footer.php”); ?>