member not activating in user activation
Posted: Mon Dec 09, 2013 8:01 pm
hya i have followed this tutorial twice now and when u register the activation email comes through when i click it i get your account has been activate but when i try to login i get This account has not yet been activated.
and it generates a error in cpanel saying the following: [09-Dec-2013 13:20:15 America/Chicago] PHP Parse error: syntax error, unexpected T_STRING in /home/matureuk/public_html/core/inc/user.inc.php on line 62
if anyone can help would be much help
heres the coding for user.inc.php:
and it generates a error in cpanel saying the following: [09-Dec-2013 13:20:15 America/Chicago] PHP Parse error: syntax error, unexpected T_STRING in /home/matureuk/public_html/core/inc/user.inc.php on line 62
if anyone can help would be much help
heres the coding for user.inc.php:
<?php // checks if the given username exists in the database. function user_exists($user){ $user = mysql_real_escape_string($user); $total = mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `user_name` = '{$user}'"); return (mysql_result($total, 0) == '1')? true : false; } // checks if the given username and password combination is valid. function valid_credentials($user, $pass){ $user = mysql_real_escape_string($user); $pass = mysql_real_escape_string($pass); $total = mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `user_name` = '{$user}' AND `user_password` = '{$pass}'"); return (mysql_result($total, 0) == '1') ? true : false; } //checks if the given user account is active. function is_active($user){ $user = mysql_real_escape_string($user); $sql = "SELECT COUNT(`user_activation`,`user_id`) FROM `users` INNER JOIN `user_activations` ON `users`,`user_id` = `user_activations`,`user_id` WHERE `users`,`user_name` = '{$user}'"; $result = mysql_query($sql); return (mysql_results($result, 0) == '0') ? true : false; } // activates the account related to the given activation code. function activate_account($aid){ $aid = mysql_real_escape_string($aid); mysql_query("DELETE FROM `user_activations` WHERE `activation_code` = '{$aid}'"); } //adds a user to the database. function add_user($user, $email, $pass){ $user = mysql_real_escape_string(htmlentities($user)); $email = mysql_real_escape_string($email); $pass = sha1($pass); $charset = array_flip(array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9'))); $aid = implode('', array_rand($charset, 10)); $body =" Hi, Thanks for registering, before you login you need to activate your account. To do that simply click the following link. http://www.matureukswingers.co.uk/activ ... ?aid={$aid}} "; mail($email, 'Your new account at matureukswingers.co.uk', $body, 'From: matureukswingers.co.uk'); mysql_query("INSERT INTO `users` (`user_name`, `user_password`, `user_email`) VALUES ('{$user}', '{$pass}', '{$email}')"); $user_id = mysql_insert_id(); mysql_query("INSERT INTO `user_activations` (`user_id`, `activation_code`) VALUES ({$user_id},'{$aid}')"); } ?>