5 replies
I have a membership site that automatically emails the member a verificaton link, I signed up myself to see how it worked and got this ERROR MESSAGE after clicking the verification link...


My code for the validate.php file is below, if someone can point out the error in the code that would be great its not that long of string of code.....

-----------------

<?php
include "conn.php";
$vcode=$_GET[vcode];


$sql1 = "Select * from members where status='Verified'";
$rec1 = mysql_query($sql1,$db) or die (mysql_error());
$trows1 = mysql_numrows($rec1);
$sql = "Select * from members where vcode='$vcode'";
$rs = mysql_query($sql,$db) or die(mysql_error());
$tr=mysql_numrows($rs);
$datas = mysql_fetch_array($rs);

if($tr>0)
{
$sq = "UPDATE members SET status = 'Verified' , vcode='Done' WHERE vcode = '$vcode'";
mysql_query($sq) or dier(mysql_error());
$contents = "<font size='4'> Thank You! Your account is now confirmed... </font><br/><br/><p> <b>You can login now from the "Login" link located to your left under the Members drop down menu.</b>
<br>
";
}
else
{
$contents = "Sorry but we can't complete your request... There are some reason why: <p> <li>Incorrect verification URL </li><li>This account is already verified</li><li>Or This account was banned</li><p>
<br>
If you have questions please send email to webmaster@$domain

";
}
include "template.php";

?>


--------------

Thanks for any help...........
#php #simple
  • Profile picture of the author kuzmanin
    try this one:
    <?php
    include "conn.php";
    $vcode=$_GET[vcode];


    $sql1 = "Select * from members where status='Verified'";
    $rec1 = mysql_query($sql1,$db) or die (mysql_error());
    $trows1 = mysql_numrows($rec1);
    $sql = "Select * from members where vcode='$vcode'";
    $rs = mysql_query($sql,$db) or die(mysql_error());
    $tr=mysql_numrows($rs);
    $datas = mysql_fetch_array($rs);

    if($tr>0)
    {
    $sq = "UPDATE members SET status = 'Verified' , vcode='Done' WHERE vcode = '$vcode'";
    mysql_query($sq) or dier(mysql_error());
    $contents = "<font size='4'> Thank You! Your account is now confirmed... </font><br/><br/><p> <b>You can login now from the \"Login\" link located to your left under the Members drop down menu.</b>
    <br>
    ";
    }
    else
    {
    $contents = "Sorry but we can't complete your request... There are some reason why: <p> <li>Incorrect verification URL </li><li>This account is already verified</li><li>Or This account was banned</li><p>
    <br>
    If you have questions please send email to webmaster@$domain

    ";
    }
    include "template.php";

    ?>
    {{ DiscussionBoard.errors[1277813].message }}
    • Profile picture of the author Steve Wells
      I tried it and now I get this NEW message



      LINE 18 has the error now........
      Signature
      Need Custom Graphics Work? - Message Me For A Design Quote!
      {{ DiscussionBoard.errors[1277910].message }}
      • Profile picture of the author Bruce Hearder
        I think I spot the error (actually 2 errors)

        The original code is :
        $sq = "UPDATE members SET status = 'Verified' , vcode='Done' WHERE vcode = '$vcode'";
        mysql_query($sq) or dier(mysql_error());
        $contents = "<font size='4'> Thank You! Your account is now confirmed... </font><br/><br/><p> <b>You can login now from the "Login" link located to your left under the Members drop down menu.</b>
        <br>
        ";

        I have color coded the errors in red

        First 1, should be die and not dier

        Second one, replace "Login" with \"Login\"

        That should do it..

        Hope this helps

        Bruce
        {{ DiscussionBoard.errors[1277945].message }}
        • Profile picture of the author Steve Wells
          Thanks it worked,,,,,,, yeee haaa!!!
          Signature
          Need Custom Graphics Work? - Message Me For A Design Quote!
          {{ DiscussionBoard.errors[1277973].message }}
          • Profile picture of the author Bruce Hearder
            Glad its working..

            I've just the past few hours debugging a WordPress plugin that I am writing, endless fun!

            The plugin replaces a lot of the "lost" pinging functionality of Wordpress MU, so now it pings like a normal blog again..

            Oh XMLRPC can be such fun !

            Take care

            Bruce
            {{ DiscussionBoard.errors[1277989].message }}

Trending Topics