Welcome to WebmasterWorld Guest from 22.214.171.124 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Pubcon Website
updating global variables how to cary new variables to other pages whatson msg:4496099 4:46 am on Sep 17, 2012 (gmt 0) e.g. I fill in a form for an inquiry on a used car. Then all the other used car inquiry forms will contain the value that I used in the previous form. How can you create the variables that will used again on another page.
omoutop msg:4496144 7:40 am on Sep 17, 2012 (gmt 0)
assuming all of your pages are in the same domain, $_SESSION is one way to do what you want. After submitting your form, you can assign $_POST data to $_SESSION for example: session_start(); $_SESSION['myVar'] = $_POST['myVar']; session_start() must be always ontop of all your scripts if you're gonna use sessions. Start reading about $_SESIONS here [ php.net] jadebox msg:4496435 10:03 pm on Sep 17, 2012 (gmt 0)
In addition to using a session, other options are to pass values as hidden fields in the forms; store values in cookies, or store information on the server (for example, in a database). -- Roger whatson msg:4497009 7:40 pm on Sep 18, 2012 (gmt 0)
Oh right, thanks Roger, that makes sense.