Jump to content


Photo

Help needed~ variables.


  • Please log in to reply
2 replies to this topic

#1 Dobakat

Dobakat
  • Members
  • PipPipPip
  • Advanced Member
  • 54 posts

Posted 26 April 2006 - 04:06 AM

Well I got a site were you can register. To register there are 3 steps. In the first step you only submit a disired and you click a button to go to next page, which is step#2. In the second page the username that was inputted in the first page is gotten using
  $user=$_POST['user'];
and then it generates a random string using
  $random = $session->generateRandStr(8)
and stores it variable $random,
After the page is loaded, they click a button again to go to next page, step #3.
Here is were the problem starts. I want to pas the two varibles to page 3. the variabes are:
$user (varible gotten from a form in page one, it worked fine in page 2)
$random (a variable generated each time the second page is loaded)

I tried carrying the variables in the url using:
register3.php?var1=$random&var2=$user
but it fail to get them in the third page, I also tried ussing hidden variables, but when I tried to get them in page 3 I got an error:
Parse error: parse error, unexpected T_VARIABLE in /home/dobakat/public_html/members/register3.php

Well can someone help me, please?
If you need the whole code of the 3 pages let me know.

#2 PWD

PWD
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 26 April 2006 - 04:10 AM

You could store the info in a session variable. That way you would only need to use the following to recall those values on ANY page:

<?php

echo $_SESSION['Data1'];

?>
[!--fonto:Geneva--][span style="font-family:Geneva"][!--/fonto--]My Gratitude---[!--fontc--][/span][!--/fontc--]
(My gratitude in advance for helping me learn; so I may one day give as freely as you have here today)
----------
[!--sizeo:5--][span style="font-size:18pt;line-height:100%"][!--/sizeo--][!--fonto:Optima--][span style="font-family:Optima"][!--/fonto--][!--coloro:red--][span style="color:red"][!--/coloro--]PWD[!--sizec--][/span][!--/sizec--][!--colorc--][/span][!--/colorc--][!--fontc--][/span][!--/fontc--]

#3 Dobakat

Dobakat
  • Members
  • PipPipPip
  • Advanced Member
  • 54 posts

Posted 26 April 2006 - 04:19 AM

Well I eddited this reply, since I fixed my problem. I don't even know how. I believe I didn't even change a thing, but it worked.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users