Jump to content
MakeWebGames

could i have 20 seconds of your time please!? help needed


bennyh

Recommended Posts

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

Link to comment
Share on other sites

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());

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.   Paste as plain text instead

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