Jump to content


Photo

Random numbers+letters, pasing them to next page.


  • Please log in to reply
2 replies to this topic

#1 Dobakat

Dobakat
  • Members
  • PipPipPip
  • Advanced Member
  • 54 posts

Posted 24 April 2006 - 03:56 AM

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?

#2 slashemail

slashemail
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 24 April 2006 - 09:14 AM

A simple solution to your problem would be.

1. Just pass the values through the pages using hidden variables.
or
2.Maintain a session variable which will update the variable on every visit to the page.

Happy Hacking:)

#3 Yesideez

Yesideez
  • Members
  • PipPipPip
  • Advanced Member
  • 2,334 posts
  • LocationDevon, UK

Posted 24 April 2006 - 09:58 AM

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.
Not a pro just an enthusiast :)

if (empty($coffee)) {$coffee=new coffee();}

Please surround any code using the CODE tags - I rarely look at anything without them




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users