jgab Posted October 2, 2012 Share Posted October 2, 2012 (edited) Hi , i'm new to php. i'm creating a signup form with email verification (PHPmailer) everything seems to work except when the user confirm the email, their information does not save to the database , so they can't login their account. the error is with the INSERT INTO customer part. can someone help me? thanks <?php if (isset($_GET["passkey"])) { $confirm = $_GET["passkey"]; $con = mysql_connect("localhost","root"); if (!$con) echo(mysql_error()); else { mysql_select_db("dbhotel",$con); $sql = "SELECT * FROM temp WHERE ConfirmCode = '" . $confirm . "'"; $rs = mysql_query($sql,$con); if (mysql_num_rows($rs) == 1) { $rows = mysql_fetch_assoc($rs); $sql = "INSERT INTO customers(FName,LName,Title,Address,Phone,Email,Password) VALUES ('". $rows["FName"] . "','" . $rows["LName"] . "','" . $rows["Title"] . "','" . $rows["Address"] . "','" . $rows["Phone"] . "','" . $rows["Email"] . "','" . $rows["Password"]."')"; mysql_query($sql,$con); $sql = "DELETE FROM temp WHERE ConfirmCode = '" . $confirm . "'"; mysql_query($sql,$con); echo "Congratulations " . $rows["Title"] ." ". $rows["FName"] ." ". $rows["LName"] . ", you are now a member!"; } else { echo "Sorry, we are unable to process your request at this moment. Please try again later."; } } mysql_close($con); } else { echo "You do not have enough permissions to access this page."; } ?> Edited October 2, 2012 by PFMaBiSmAd code in code tags please Quote Link to comment https://forums.phpfreaks.com/topic/268989-php-registration-with-email-verification-help/ Share on other sites More sharing options...
White_Lily Posted October 2, 2012 Share Posted October 2, 2012 What is the error that comes up saying? Quote Link to comment https://forums.phpfreaks.com/topic/268989-php-registration-with-email-verification-help/#findComment-1382185 Share on other sites More sharing options...
Christian F. Posted October 2, 2012 Share Posted October 2, 2012 I recommend that you read this article. Quote Link to comment https://forums.phpfreaks.com/topic/268989-php-registration-with-email-verification-help/#findComment-1382187 Share on other sites More sharing options...
White_Lily Posted October 2, 2012 Share Posted October 2, 2012 Suggestion: make sure the "pass-key" is actually visible in the url of the page, if its not - theres your problem Quote Link to comment https://forums.phpfreaks.com/topic/268989-php-registration-with-email-verification-help/#findComment-1382189 Share on other sites More sharing options...
MDCode Posted October 2, 2012 Share Posted October 2, 2012 (edited) $confirm = $_GET["passkey"]; Make sure you filter that with mysql_real_escape_string or it will be a security risk. Edited October 2, 2012 by ExtremeGaming Quote Link to comment https://forums.phpfreaks.com/topic/268989-php-registration-with-email-verification-help/#findComment-1382219 Share on other sites More sharing options...
White_Lily Posted October 2, 2012 Share Posted October 2, 2012 Really security isnt really a problem atm, you cant secure something that isnt there lol Quote Link to comment https://forums.phpfreaks.com/topic/268989-php-registration-with-email-verification-help/#findComment-1382226 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.