graham23s Posted October 20, 2008 Share Posted October 20, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/129158-not-updating-mysql-but-says-it-is/ Share on other sites More sharing options...
Bendude14 Posted October 20, 2008 Share Posted October 20, 2008 why this line? before you update? print("$email = $action"); Also lower down you are using REQUEST which is not recommend use either $_GET['email'] or $_POST['email'] Quote Link to comment https://forums.phpfreaks.com/topic/129158-not-updating-mysql-but-says-it-is/#findComment-669679 Share on other sites More sharing options...
.josh Posted October 20, 2008 Share Posted October 20, 2008 First error I see is your form uses the POST method but you are trying to grab vars from the GET method. Quote Link to comment https://forums.phpfreaks.com/topic/129158-not-updating-mysql-but-says-it-is/#findComment-669682 Share on other sites More sharing options...
iversonm Posted October 20, 2008 Share Posted October 20, 2008 do you ever activate your switch statement switch ($i) { Quote Link to comment https://forums.phpfreaks.com/topic/129158-not-updating-mysql-but-says-it-is/#findComment-669686 Share on other sites More sharing options...
redarrow Posted October 20, 2008 Share Posted October 20, 2008 are the $_get[''] from a url....... Quote Link to comment https://forums.phpfreaks.com/topic/129158-not-updating-mysql-but-says-it-is/#findComment-669691 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.