|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
php sending variables
Hello, im having a bit of trouble, i have several variables on my page that were sent by a form. I want to send these same variables onto the next page, but i dont know how. I have created a 'confirm' button whos action loads the next page, but how can i POST these variables to the page when the confirm button is clicked? i have only ever used POST when sending from a form to another page, i just wanna know how to POST variables that arent originating from a form. thanks, i hope some1 understands what im asking
|
|
#2
|
|||
|
|||
|
RE: php sending variables
you have several options. You might want to store the values in a cookie then when you reach the other page clear the cookie. or more simply you can use hidden fields on the second page to pass on information from the first page onto the third page. There should be other ways of doing this.
|
|
#3
|
|||
|
|||
|
RE: php sending variables
i don't know if it is necessary that you use 3 pages but if i was doing it i would probably merge the last two pages and just use an if statement to separate the two.
Hint: if you post some codes i and more people would be willing to help. |
|
#4
|
|||
|
|||
|
Message Moved
Thread moved from 'PHP Coding' to 'Programming Theory' by CodeKadiya.
Reason: theory stuff... |
|
#5
|
|||
|
|||
|
RE: php sending variables
No, he is asking how to pass variable values without using a form. You got to have a form to have hidden fields.
You have few options. eg: Query string, Sessions, Cookies I recommened to use query string method. You can appened your variable values to URL something like this: http://yourdomian.com/index.php?name=Mike Then you can write this simple php code to grab value of name variable: |
|
#6
|
|||
|
|||
|
RE: php sending variables
Tutorials
Sessions in PHP http://codewalkers.com/tutorials.php?show=32&page=1 Cookies in PHP http://codewalkers.com/tutorials.php?show=60&page=1 |
|
#7
|
|||
|
|||
|
RE: php sending variables
Hello again
Sessions are both easy and hard to handle Sessions are easy to code |
|
#8
|
|||
|
|||
|
RE: php sending variables
they are not that hard to handle just ensure that you use session_start(); at the begining of the pages. then all you have to do is call on them.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > php sending variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|