Jump to content
MakeWebGames

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


Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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?

Posted

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

Posted

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

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