Jump to content

Recommended Posts

Hi Guys,

 

i can't figure this out 1 bit!

 

what im trying to do is set the enum from N to Y when an email adress is verified:

 

<?php
  case "verify-email"; 
  
    $action = trim($_GET['action']);
     $email = trim($_GET['email']);
    
    // debug
    print("$email = $action");
    
    if ($action == 'fail')
    {

    // do a verification update
    $updateQ = "UPDATE `SYLA_EMAILS` SET `STATUS`='N' WHERE `EMAIL`='$email'"; 
    $updateR = mysql_query($updateQ) or die (mysql_error());  
    
    // print failure
    print("<br /><div id=\"msg_fail\" align=\"center\"><b>Thank you, e-mail has been added to the failed list.</b></div>");
    }
    
    // update depending
    if ($action == 'pass')
    {

    // do a verification update
    $updateQ = "UPDATE `SYLA_EMAILS` SET `STATUS`='Y' WHERE `EMAIL`='$email'"; 
    $updateR = mysql_query($updateQ) or die (mysql_error());  
    
    // print success
    print("<br /><div id=\"msg_success\" align=\"center\"><b>Thank you, e-mail has been added to the verified list.</b></div>");

    }
    
    // email
    $em = trim($_GET['email-to-verify']);
  
    // ten op
    $show = (isset($em)) ? "$em" : " ";
  
    begin_top_frame("Verify a members email address.");
    
    print("<form action=\"main-index.php?view-option=verify-email\" method=\"POST\" />\n");
    
    print("<table border=\"0\" cellpadding=\"5\" cellspacing=\"1\" class=\"tbl_login\">\n");
    print("<tr>\n");
    print("<td colspan=\"2\" align=\"left\" class=\"c3\"><b>E-Mail verification.</b></td>\n");
    print("</tr>\n");
    print("<tr class=\"c5\">\n");
    print("<td align=\"left\"><img src=\"images/pixel.gif\" width=\"1\" height=\"1\"></td><td align=\"left\"><img src=\"images/pixel.gif\" width=\"1\" height=\"1\"></td>\n");
    print("</tr>\n");
    print("<tr class=\"c1\">\n");
    print("<td class=\"font_for_forms\" align=\"left\">Please enter e-mail to verify:</td><td align=\"left\"><input type=\"text\" size=\"40\" name=\"email\" value=\"$show\"/></td>\n");
    print("</tr>\n");
    print("<tr>\n");
    print("<td class=\"font_for_forms\" colspan=\"2\" align=\"right\"><input type=\"submit\" name=\"submit_verify\"  value=\"Verify!\"></td>\n");
    print("</tr>\n");
    print("</table>\n");    
    
    begin_bottom_frame();    
    
    print("</form>");
    
    if (isset($_POST['submit_verify']))
    {
    
        begin_top_frame("Verification results <img src=\"images/3dots.gif\">");
    
    // print debug box
    //print("<table align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\" class=\"tbl_login\">\n");
    //print("<tr>\n");
    //print("<td colspan=\"2\" align=\"left\" class=\"c3\"><b>Verification results...</b></td>\n");
    //print("</tr>\n");
    //print("<tr class=\"c5\">\n");
    //print("<td align=\"left\"><img src=\"images/pixel.gif\" width=\"1\" height=\"1\"></td>\n");
    //print("</tr>\n");
    //print("<tr>");
    //print("<td align=\"left\">");
    
    $dis = trim($_REQUEST['email']);
    
    $error = validateEmail($dis, true, true, '[email protected]', 'outkast.tienhuis.nl', true);
    
    if ($error) {
        print("<h5><b><font color=\"red\">Error!</font> $error <img src=\"images/thumbsdown.gif\"></b> - [<a href=\"main-index.php?view-option=verify-email&email=$dis&action=fail\" class=\"smart_links\">Add to failed</a>]</h5>");
    } else {
        print("<h5><b><font color=\"green\">Success!</font> the e-mail address  <i>$dis</i>  looks to be active <img src=\"images/thumbsup.gif\"></b> - [<a href=\"main-index.php?view-option=verify-email&email=$dis&action=pass\" class=\"smart_links\">Add to verified</a>]</h5>");
    }
    
    //print("</td>");
    //print("</tr>");
    //print("</table>");  
    
        begin_bottom_frame();   
    
    } 
    
  break; 
?>

 

i have checked the values are getting through ok they are fine! i have echoed out the query strings it all looks ok! it just doens't update mysql!! even though test indicate a 1 back

 

can anyone see the problem at all?

 

cheers guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/129158-not-updating-mysql-but-says-it-is/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.