Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 822 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with a simple script

#1
Hello! I have a problem with a script I wrote. It's basically an email activation script. It sends the email, but when I do this:

PHP Code:
<?php
include('includes/header.php');
include(
"includes/config.php");

$email $_GET['email'];
$key $_GET['key'];

$email strip_tags($email); 
$email trim($email);
$key strip_tags($key); 
$key trim($key);
 
$sql mysql_query("SELECT * FROM confirm WHERE email = '$email' AND key = '$key' ORDER BY id LIMIT 1")or die(mysql_error());
while(
$result mysql_fetch_array($sql)) ;

$key2 $result['key']; 
$email2 $result['email'];  
}

if(
$key == $key2 && $email == $email2){

$sql mysql_query("UPDATE users SET user_confirm = 1 WHERE user_mail = '$email2'")or die(mysql_error());
echo 
"Your account have been activated, and is ready to use!";

}else{
echo 
'The key or email does not fit to these you entered in URL at the begining, or other error occured! Contact an admin!';
}
include(
'includes/footer.php');
?>

It gives me this:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Any idea where I went wrong in the first query?
I am sure that the tables and fields that are getting called exists in the database.
Reply

#2
PHP Code:
$sql mysql_query("SELECT * FROM confirm WHERE email = '$email' AND key = '$key' ORDER BY id LIMIT 1")or die(mysql_error()); 

this needs to be

PHP Code:
$sql mysql_query("SELECT * FROM confirm WHERE email = '$email' AND key = '$key' ORDER BY id ASC LIMIT 1")or die(mysql_error()); 

as it doesn't know how it should be ordered
Reply

#3
Thanks for answer, but I'm still getting same error as before :S I tried also using DESC instead of ASC, and it did not work either.. Any idea what more it could be?
Reply

#4
Please contact me and i can try to help :biggrin:

- EKNOZ
Reply

#5
Try:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


I don't really code in PHP, but LIMIT looks like a range thing to me.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through