Jump to content

email account actiavtion script


dbldee

Recommended Posts

<?php

include($DOCUMENT_ROOT . '/vars.php');
include($DOCUMENT_ROOT . '/headfoot.php');
mysql_connect($db_host, $db_user, $db_passwd);
mysql_select_db($db_name);
if (!isset($ac) || !is_numeric($ac) || !isset($i) || !is_numeric($i)) {
    echo("<head><title>$title</title><meta http-equiv=\"Refresh\" content=\"1;URL=$self_url\"></head><body><span style=\"font-size:250%\">$title</span><br><span style=\"font-size:150%\">Failed to resolve activation code!</span></body></html>");
    exit;
}
$res = mysql_query("select email from user where id=$i && ac=$ac");
if (mysql_num_rows($res) != 1) {
    echo("<head><title>$title</title><meta http-equiv=\"Refresh\" content=\"1;URL=$self_url\"></head><body><span style=\"font-size:250%\">$title</span><br><span style=\"font-size:150%\">Failed to resolve activation code!</span></body></html>");
    exit;
}
$email = mysql_result($res, 0);
$res = mysql_query("update user set ac=0 where id=$i");
uheader();
echo("<p align=center class=big>Your account was activated!</p>");
echo("<form action=/members/ method=post><input type=hidden name=form value=sent><div align=center><b>You may now log in:</b><br>");
echo("E-mail:<br><input type=text name=email size=10 maxlength=100 value=$email><br>Password:<br><input type=password name=passwd size=10 maxlength=20><br><input type=submit value=\"Log in\"></div></form>\n");
ufooter();
mysql_close;
?>

 

Can someone help with the logic, I am new to Php and need some help

It only returns the error :Failed to resolve activation code

 

Another question?

 

Is there utility for debugging php Scripts while they remain on the server?

Link to comment
https://forums.phpfreaks.com/topic/36640-email-account-actiavtion-script/
Share on other sites

Could you change the two error sections to include say error number one and two

 

ie: if (!isset($ac) || !is_numeric($ac) || !isset($i) || !is_numeric($i)) {

    echo("<head><title>$title</title><meta http-equiv=\"Refresh\" content=\"1;URL=$self_url\"></head><body><span style=\"font-size:250%\">$title</span><br><span style=\"font-size:150%\">ERROR #1: Failed to resolve activation code!</span></body></html>");

    exit;

 

 

Just to help figure out where the program is failing!

 

-Andy

Hmm ok if its the second instance.. i would say that its a mysql error.. backup up that theory with your warning that are on the lines for the mysql functions..

What warnings are you getting.. and are you sure theres not more then one user with that email address?

 

-Andy

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.