Thread: mail() problem
View Single Post
  #1 (permalink)  
Old May 10th, 2006, 16:44
asa_carter asa_carter is offline
New Member
Join Date: Jan 2006
Age: 30
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
mail() problem

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:

PHP: Select all

header("location: registerc.php"); 

registerc.php:

PHP: Select all

<? 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], \n\n";
  
$body .= "Click the link below to activate your Auction.Beta account: \n\n";
  
$body .= "http://www.argyllnewmedia.co.uk/auction/validate.php?u=$l_row[0]&v=$l_row[3] \n\n";
  
$body .= "If you're unable to click the link above, cut and paste it into your web browser. \n\n";
  
$body .= "Should you forget your password, you can request a new one which will be sent to this email address. \n\n";
  
$body .= "Thank you for registering. \n\n\n";
  
$body .= "Auction.Beta Team \n\n";
  
$from "registration@auction.co.uk";
  
$mailheader "From: $from\r\n";
  
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 "registration@auction.beta"</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"); ?>
Reply With Quote