Dobakat Posted April 24, 2006 Share Posted April 24, 2006 Well I want people(Tibian members) to sign in for my page. For this I am asking to put their character's name ('Dobakat' as an example), then they are taken to another page were they are given a random code. Lets say the random code was 'a1b2c3', then they have to put that in random code in their comments of their true Tibian account(for an example of this Tibia user infomation pages, [a href=\"http://www.tibia.com/community/?subtopic=character&name=Dobakat)\" target=\"_blank\"]http://www.tibia.com/community/?subtopic=c...r&name=Dobakat)[/a] , and click 'validate'. I know how to make it so it gets the comments that person has on their Tibia characters comments, but I don't know how to make it remember the random code that was made on the page before, so it can search for it in the comments. I know how to make it so it gets the comments that person has on their Tibia characters comments, but I don't know how to make it remember the random code that was made on the page before so it can search for it in the comments. Should I make a variable, or is there a better, most reliable way. After prooving that that Tibian character belongs to them they continue registration(which I know how to do it.)What I am trying to do is basically what this site has:[a href=\"http://www.mytibia.com/register.php\" target=\"_blank\"]http://www.mytibia.com/register.php[/a]This is what I got.[a href=\"http://www.istariguild.com/members/register.php\" target=\"_blank\"]http://www.istariguild.com/members/register.php[/a]In a few words, my question is:What is the best way to get a variable ($random) from the previous page. This variable is random, and changes each time the page is loaded.Should I make the variable global? or is there another way? Quote Link to comment Share on other sites More sharing options...
slashemail Posted April 24, 2006 Share Posted April 24, 2006 A simple solution to your problem would be.1. Just pass the values through the pages using hidden variables.or2.Maintain a session variable which will update the variable on every visit to the page.Happy Hacking:) Quote Link to comment Share on other sites More sharing options...
Yesideez Posted April 24, 2006 Share Posted April 24, 2006 You're wanting to basically make a register routine with a random code that is to validate the user's account when they activate it?What I did with my game was to have an extra table in the database called activation and it had the following fields:username VARCHAR(20)code VARCHAR(10)dt INT UNSIGNEDWhen the user made a new account it'd add them to the members table but also create an entry in the activation table. The email that was sent to them upon registration had a link they had to click to activate their account and was something like this:activate.php?username=yesideez&code=4g4g6r89g6The dt field was used to delete those who didn't activate their account within 12 hours. In the activate.php script it would check the activation table for the username and code. If both matched the entry in the table was deleted and a field in the members table called activated (TINYINT(1) UNSIGNED) was set to 1. If either didn't match they were told and nothing was changed. Quote Link to comment 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.