|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Redirecting users with php.
I am creating an ordering system and I need to send information between pages. Currently I am using php and forms to send the information from one page to another.
Right now however I am stuck because I need to analyze some information: if it is answer A redirect to page A, B redirect to page B, and neither return to previous page. Currently my problem consists where I cannot figure out how to automatically redirect and send variables to the next .php. I know how to redirect via headers: PHP Code:
</font> </font> and Meta tags: HTML Code: Code:
<META HTTP-EQUIV="refresh" CONTENT="1;URL=http://www.test.com/"> Any suggestions? Do I need to clarify? THanks in advance for the assistance. Xadio |
|
#2
|
|||
|
|||
|
I would recommend using the header redirection but remember you can only use this method if NOTHING has been sent to the browser yet. To pass information on to the page your redirecting to build a query string and add it on to the url you redirect to. eg
www.test.com/whatever/page.php?var1=a&var2=b Then you can get this information out the other side using the $_GET array. Hope this helps, -KM- |
|
#3
|
|||
|
|||
|
I see... thank you much. I didn't know that. Again thank you very much!
|
|
#4
|
|||
|
|||
|
As another thought you could also store the information in session data and access it via $_SESSION. Theres loads of internet tutorials about session data around so won't bother repeating the details.
-KM- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Redirecting users with php. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|