gnetuk Posted April 24, 2012 Share Posted April 24, 2012 Hi all. Can someone tell me why i get two emails when somone has activated on my site. I only need the one lol. heres my code <?php session_start(); include ('dbc.php'); if (!isset($_GET['usr']) && !isset($_GET['code']) ) { header("Location: register.php?msg=ERROR: You have not activated PLEASE USE VALID E-MAIL...."); }else $rsCode = mysql_query("SELECT activation_code from usersgnet where user_email='$_GET[usr]'") or die(mysql_error()); list($acode) = mysql_fetch_array($rsCode); if ($_GET['code'] == $acode) { mysql_query("UPDATE usersgnet set user_activated=1 where user_email='$_GET[usr]'") or die(mysql_error()); mail( '[email protected]', 'ACTIVATION A C T I V A T E D D O N E new member SET', 'Check the http://gnetuk.net/forum/admin/index.php', "From: \"www.gnetuk.net DO NOT REPLY\" <[email protected]>\r\n" . "X-Mailer: PHP/" . phpversion()); }else { header("Location: register.php?msg=ERROR: You have not activated PLEASE USE VALID E-MAIL...."); die("chedktjhe. Pultravigenslips.."); } ?> Any ideas. gnetuk :-) Quote Link to comment https://forums.phpfreaks.com/topic/261554-x-mailer-php-phpversion/ Share on other sites More sharing options...
MMDE Posted April 24, 2012 Share Posted April 24, 2012 I couldn't see any loops in your script, and the mail function only appears once. I see so some redirects, so I'm gonna go ahead and guess it redirects to the same page. I've never seen else been used like that before. }else $rsCode = mysql_query("SELECT activation_code from usersgnet where user_email='$_GET[usr]'") or die(mysql_error()); list($acode) = mysql_fetch_array($rsCode); if ($_GET['code'] == $acode) { Quote Link to comment https://forums.phpfreaks.com/topic/261554-x-mailer-php-phpversion/#findComment-1340244 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.