Yes im having abit of a problem with some hacking here. Maybe someone can help me out. Worth a shot huh? :p Okay here it goes.
I started to work on a hack that will remember if a user has clicked the I Agree on a T.O.S. Page. I was told to use a session or a setcookie. But then i decided to go ahead and do it this way:
add a field to the user table called 'tos' or 'agree' or something - enum ('n','y');
set all current and new users to 'n';
on the usercp.php page, once they successfully enter it, check this field - if it's set to 'n' then show the user agreement form - if it's set to 'y' then let them go to there user cp panel.
So heres what i did.
I ran this SQL Query:
[sql]
ALTER TABLE user ADD tos ENUM('n','y') DEFAULT 'n';
[/sql]
And this is what you put in the begining of the usercp.php after permissions are checked.
You must first be a
registered member to view any code.
then the agreement template is this:
You must first be a
registered member to view any code.
Then i made a tos.php file with this:
You must first be a
registered member to view any code.
But when i go to the usercp.php i get this error now from the or die(mysql_error()
Quote:
|
Unknown column 'id' in 'where clause'
|
Any ideas? Someone told me to do this sql
[sql]ALTER TABLE user ADD id BIGINT NOT NULL;[/sql]
and when i did that i had this problem. lets say no users have clicked i agree yet. And user A logs in and see the new agreement, then clicks the i agree button. Then he is redirect back to the usercp page. which is perfect. But now when user B logs in, he don't see it cause user A has clicked yes. This is vice versa also. Seems if any one person clicks yes, it sets yes to all.
i was told it may be that the $user array isn't returning the user data.
Any other ideas why? Thanks guys