Jump to content

Random numbers+letters, pasing them to next page.


Dobakat

Recommended Posts

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?
Link to comment
Share on other sites

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 UNSIGNED

When 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=4g4g6r89g6

The 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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.