bennyh Posted August 17, 2009 Posted August 17, 2009 When my users validate their email account it deletes them from the validate table but its not entering them into my users database Can anyone help me please? below is my validate page <?php session_start(); require "mysql.php"; global $c; if ( $_GET['act'] == 'val') { $q=mysql_query("SELECT * FROM validating WHERE vdID='{$_GET['token']}'", $c); if (!mysql_num_rows($q)) { die("Invalid account"); } $r=mysql_fetch_array($q); $pass=strip_tags($r['vdPASSW']); $pass=md5($pass); $username=($r['vdUSERN']); $email=($r['vdEMAIL']); $money=($r['vdMONEY']); mysql_query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 2, 2, 1, 12, 12, 100, 100, 5, 5, 100, 100, 9, 'Male', unix_timestamp(), '{$_POST['email']}', -1, '$ip')", $c); $i=mysql_insert_id($c); mysql_query("INSERT INTO userstats VALUES($i,10,10,10,10,10)",$c); mysql_query("DELETE FROM validating WHERE vdID='{$_GET['token']}'", $c); print "Account validated! [url='login.php']> Login[/url]"; } else { mysql_query("DELETE FROM validating WHERE vdID='{$_GET['token']}'", $c); print "Registration Cancelled."; } ?> THANKS Quote
gurpreet Posted August 17, 2009 Posted August 17, 2009 Re: could i have 20 seconds of your time please!? help needed The users is in the if, the validate query is in the else. Should give yo ua hint Quote
bennyh Posted August 18, 2009 Author Posted August 18, 2009 Re: could i have 20 seconds of your time please!? help needed I dont get it :? Sorry am i being stupid Quote
Haunted Dawg Posted August 18, 2009 Posted August 18, 2009 Re: could i have 20 seconds of your time please!? help needed Change this: mysql_query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 2, 2, 1, 12, 12, 100, 100, 5, 5, 100, 100, 9, 'Male', unix_timestamp(), '{$_POST['email']}', -1, '$ip')", $c); to mysql_query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 2, 2, 1, 12, 12, 100, 100, 5, 5, 100, 100, 9, 'Male', unix_timestamp(), '{$_POST['email']}', -1, '$ip')", $c) or die(mysql_error()); Quote
bennyh Posted August 19, 2009 Author Posted August 19, 2009 Re: could i have 20 seconds of your time please!? help needed Thanks for your reply but i get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 2, 2, 1, 12, 12, 100, 100, 5, 5, 100, 100, 9, 'Male', unix_timestamp(), '', -1,' at line 1 Quote
wolfe Posted August 19, 2009 Posted August 19, 2009 Re: could i have 20 seconds of your time please!? help needed You have it inserting $sm. What is $sm? Is it supposed to be the money? Because you have $money already and i dont see $sm in there. Quote
Haunted Dawg Posted August 19, 2009 Posted August 19, 2009 Re: could i have 20 seconds of your time please!? help needed change this: $money=($r['vdMONEY']); to $sm = $r['vdMONEY']); Quote
CrazyT Posted August 20, 2009 Posted August 20, 2009 Re: could i have 20 seconds of your time please!? help needed if ( $_GET['act'] == 'val') { $q=mysql_query("SELECT * FROM validating WHERE vdID='{$_GET['token']}'", $c); if (!mysql_num_rows($q)) { die("Invalid account"); } @bennyh were's the secuirty on that? Quote
bennyh Posted August 20, 2009 Author Posted August 20, 2009 Re: could i have 20 seconds of your time please!? help needed Again thanks for all the replies the error has gone but now when they press the link to validate it says account vaidated but they cannot login, again its not entering them into the users database? Any ideas Whoever can help i will pay $5 Thanks Ben Quote
bennyh Posted August 20, 2009 Author Posted August 20, 2009 Re: could i have 20 seconds of your time please!? help needed UPDATE: Its now not deleting them from the validate table so therefore its not adding them into the user table as i said $5 to whoever can fix it Bennyh Quote
Haunted Dawg Posted August 21, 2009 Posted August 21, 2009 Re: could i have 20 seconds of your time please!? help needed add me to msn @ [email protected] Quote
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.