Jump to content


Photo

pass var from one page to another


  • Please log in to reply
5 replies to this topic

#1 zhahaman2001

zhahaman2001
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 06 October 2006 - 11:52 PM

ok on my site i have a lot of links that look like this
<a href=nextpage.php?var=$var>Next Page</a>
because thats the only way i know to pass vars from one page to another easly is there any other way like the html <form> way (i dont like the html form way because the only way i know how to do that is with a button and all i want is a text link)

#2 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 07 October 2006 - 12:13 AM

If you only want to use links then GET is your best option.

To use POST (to my knowledge), you need to use a submit input to submit the form.

#3 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 07 October 2006 - 12:14 AM

You might also look into using sessions.

#4 zhahaman2001

zhahaman2001
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 07 October 2006 - 12:21 AM

If you only want to use links then GET is your best option.

To use POST (to my knowledge), you need to use a submit input to submit the form.


can i have an code example please?

#5 zhahaman2001

zhahaman2001
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 07 October 2006 - 12:42 AM

also (the main point of this is to keep the vars hidden) is there a way to hide them from the url and source?

#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 07 October 2006 - 12:49 AM

Search for a tutorial on php sessions.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users