Current location: Hot Scripts Forums » Programming Languages » PHP » activation key problem


activation key problem

Reply
  #1 (permalink)  
Old 04-02-04, 03:58 PM
dcooldude_1's Avatar
dcooldude_1 dcooldude_1 is offline
Newbie Coder
 
Join Date: Feb 2004
Location: Sidney
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Post activation key problem

I have altered this script that I found on some site to get it to work. After
studying the script, fixing the syntax, and changing a few things, I got all of it to
work... However, I still have a problem. I made a script called ok.php to create an
activation key (just a ENCRYPT("makeactivationkey") thing). Well, for some
reason, it won't work. take a look, this is my create_entry.php, this creates the
user then goes to ok.php:

PHP Code:

 
 
 
$dbh=mysql_connect ("localhost", "myuser", "MYPASSWORD") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("hexadmin_user"); 
 
if ($submit = "Register")
{
if($password == $vpassword)
{
$query = "insert into users
         (username, password, email, name, address, city, state, date, verify) values ('$username', '$password', '$email', 
'$name', '$address', '$city', '$state', CURDATE(), ENCRYPT('createnewpass'))";
mysql_query($query) or 
             die (mysql_error());
 
print("<h3>You are now registered, going to next script</h3>");
    }
else
{
print("Your passwords didn't match. Go <a href=\"java_script_:history.back(1)\">back</a>");
}
}
else
{
print("Error in system. You weren't added");
}
?>
<script>
window.location="http://signup.webhex.net/ok.php?email=<?PHP echo $email;?>&username=<?PHP echo $username;?>";
</script>

then this is my ok.php:
PHP Code:

 
 
$user = $_GET['username']; 
$email = $_GET['email'];
$dbh=mysql_connect ("localhost", "myuser", "mypassword") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("hexadmin_user"); 
 
$result=mysql_query("Select * From users Where username='$user'") 
             or die ("No such user."); 
while ($row=mysql_fetch_array($result)) 
         { 
if ($row["username"]==$user ) 

$query = "UPDATE users SET activate = ENCRYPT('$user') WHERE username = '$user'";
mysql_query($query) or 
             die (mysql_error());
}
else
{
    print("No such user");
}
         }
}
$myKey=mysql_query("Select activate From users Where username='$user'") 
            or die ("error");
mail("$email", "Activation Key!", "WebHex.net webmasters thank you for signing 
up with our system. However, you need to activate your account by going to the 
following addess: http://signup.webhex.net/activate1.php?activationKey=$myKey
&username=$user and using the username that you used to signup with: $user and the activation key: $myKey");
?> 
Thank you <b><?PHP echo $user?></b>, for registering with WebHex.net! We 
have sent an confirmation e-mail to <b><?PHP echo $email?></b>. Please, go 
check your e-mail.
<p>
Without checking your e-mail to confirm your account, your account will not be 
active. If an account is inactive, the user can NOT sign in. Also, you MUST check it 
with-in 30 days. All accounts will be purged that have been inactive for 31 days!

COULD SOMEONE PLEASE HELP ME?!?!?!?!?!?!?!?
__________________
===================================
Dcooldude_1

Site 1: http://ih.sidneyps.com/hs/spokesman/
Site 2: http://www.webhex.net/

Go to http://www.chatzy.com/?132627185966 this is my chat area...
the password is: progtalk
===================================

Last edited by dcooldude_1; 04-02-04 at 04:01 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an activation e-mail dcooldude_1 PHP 3 03-31-04 09:30 AM
I have a problem... ICE Flame PHP 4 03-20-04 01:48 PM
Small problem for a pro, but for novice like me... argh! ntek Perl 3 11-19-03 01:45 PM
file download problem ukyankee Perl 6 10-04-03 10:39 PM
Activation Problem POPOEVER Hot Scripts Forum Questions, Suggestions and Feedback 3 06-02-03 10:26 PM


All times are GMT -5. The time now is 10:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.