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 :-) 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) { Link to comment https://forums.phpfreaks.com/topic/261554-x-mailer-php-phpversion/#findComment-1340244 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.