tecdesign Posted March 28, 2006 Share Posted March 28, 2006 I have done everything it says in the tutorial yet it won't make the account activated here is my scriptsACTIVATE.PHP<? /* Account activation script */ // Get database connection include 'db.php'; // Create variables from URL. $userid = $HTTP_GET_VARS['id']; $code = $HTTP_GET_VARS['code']; $sql = mysql_query("UPDATE users SET activated='1' WHERE userid='$userid' AND password='$code'"); $sql_doublecheck = mysql_query("SELECT * FROM users WHERE userid='$userid' AND password='$code' AND activated='1'"); $doublecheck = mysql_num_rows($sql_doublecheck); if($doublecheck == 0){ echo "<strong><font color=red>Your account could not be activated!</font></strong>"; } elseif ($doublecheck > 0) { echo "<strong>Your account has been activated!</strong> You may login below!<br />"; } ?> EmailDear adfasd asdfasdf Thank you for registering at X Tec, you now have access to the forum, blog, and the X Tec knowledge base.To confirm your registration please activate your account by clicking on the link below: [a href=\"http://www.tecdesign.co.nz/activate.php?id=12&code=22ca8686bfa31a2ae5f55a7f60009e14\" target=\"_blank\"]http://www.tecdesign.co.nz/activate.php?id...5f55a7f60009e14[/a] Once you activate your memebership, you will be able to login with the following information: Username: asfds Password: asdfasd Thanks! Matthew Jones This is an automated response, please do not reply!REGISTERIT.PHP<?php$dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());mysql_select_db ("tecdnco_xtec");$username = $HTTP_POST_VARS['username'];$db_password = $HTTP_POST_VARS['password'];$first_name = $HTTP_POST_VARS['first_name'];$last_name = $HTTP_POST_VARS['last_name'];$email_address = $HTTP_POST_VARS['email_address'];$bizname = $HTTP_POST_VARS['bizname'];$phone = $HTTP_POST_VARS['phone'];$mobile = $HTTP_POST_VARS['mobile'];$fax = $HTTP_POST_VARS['fax'];$street_address = $HTTP_POST_VARS['street_address'];$country = $HTTP_POST_VARS['country'];$region = $HTTP_POST_VARS['region'];$city = $HTTP_POST_VARS['city'];$password = md5($db_password);$sql = "INSERT INTO `members` (`username`, `password`, `first_name`, `last_name`, `email_address`, `bizname`, `phone`, `fax`, `street_address`, `country`, `city`, `region`, `mobile`)VALUES ('". $HTTP_POST_VARS['username'] ."', '$password', '". $HTTP_POST_VARS['first_name'] ."', '". $HTTP_POST_VARS['last_name'] ."', '". $HTTP_POST_VARS['email_address'] ."', '". $HTTP_POST_VARS['bizname'] ."', '". $HTTP_POST_VARS['phone'] ."', '". $HTTP_POST_VARS['fax'] ."', '". $HTTP_POST_VARS['street_address'] ."', '". $HTTP_POST_VARS['country'] ."', '". $HTTP_POST_VARS['city'] ."', '". $HTTP_POST_VARS['region'] ."', '". $HTTP_POST_VARS['mobile'] ."')"; $result = mysql_query($sql);if(!$sql) {echo "there has been a problem trying to register you as a user, please try again.";}else { $userid = mysql_insert_id(); $subject = "Registration with X Tec"; $message = " Dear $first_name $last_name Thank you for registering at X Tec, you now have access to the forum, blog, and the X Tec knowledge base.To confirm your registration please activate your account by clicking on the link below: [a href=\"http://www.tecdesign.co.nz/activate.php?id=$userid&code=$password\" target=\"_blank\"]http://www.tecdesign.co.nz/activate.php?id...=$password[/a] Once you activate your memebership, you will be able to login with the following information: Username: $username Password: $db_password Thanks! Matthew Jones This is an automated response, please do not reply!"; mail($email_address, $subject, $message, "From: X Tec support@tecdesign.co.nz\n X-Mailer: PHP/" . phpversion()); echo 'Your membership information has been mailed to your email address! Please check it and follow the directions!'; } ?>I am not sure what the problem is I have constantly checked the code and it makes sense to me but not to the server. Quote Link to comment https://forums.phpfreaks.com/topic/6037-activatephp-membership-tutorial/ Share on other sites More sharing options...
tecdesign Posted March 29, 2006 Author Share Posted March 29, 2006 by the way I am using php 4.41 and mysql 4.0.25 Quote Link to comment https://forums.phpfreaks.com/topic/6037-activatephp-membership-tutorial/#findComment-21789 Share on other sites More sharing options...
tecdesign Posted March 29, 2006 Author Share Posted March 29, 2006 I solved the problem. my table was called members not users. LOL it is always something stupid. Quote Link to comment https://forums.phpfreaks.com/topic/6037-activatephp-membership-tutorial/#findComment-21794 Share on other sites More sharing options...
AdRock Posted August 4, 2006 Share Posted August 4, 2006 where did you find the tutorial?....i have been looking for ages but can't find one anywhere. Quote Link to comment https://forums.phpfreaks.com/topic/6037-activatephp-membership-tutorial/#findComment-68908 Share on other sites More sharing options...
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.