Registration: User Activation & Running script online

Post here is you are having problems with any of the tutorials.
Post Reply
salrathor1
Posts: 26
Joined: Tue Jun 21, 2011 2:23 am

Registration: User Activation & Running script online

Post by salrathor1 »

Hey guys, I hope you're all doing well.

I have two problems.

1. I've followed the tutorials for creating a registration/login system with the activation codes. It all seems to work fine but when I enter the activation code it doesn't seem to delete the row in the `user_activations` table.

2. I tried to run my register/login script online via bluehost and when I submit the page turns blank.

Any ideas?

Thanks.

user.inc.php
[syntax=php]

//activates the account related to given code.
function activate_account($aid) {
$aid = mysql_real_escape_string($aid);

mysql_query("DELETE FROM `user_activations` WHERE `activation_code` = '{$aid}'");

[/syntax]

activate.php
[syntax=php]
<?php

include('/core/init.inc.php');


if (isset($_GET['$aid'])) {
activate_account($_GET['aid']);
}

?>


<p>

Your account has been activated, you can now <a href="login.php"> log in</a>
</p>
[/syntax]
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Registration: User Activation & Running script online

Post by Temor »

This reply is way late, but for future reference:

If your MySQL queries return null, or won't do what you want them to, try echoing mysql_error()
like so:
[syntax=php]echo mysql_error();[/syntax]
Post Reply