Re: Passing variables from a primary web page to a web page that is two levels below

From: Date: Tue, 29 Apr 2003 08:41:25 +0000
Subject: Re: Passing variables from a primary web page to a web page that is two levels below
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-145596@lists.php.net to get a copy of this message
It depends on how your getting from page 2 to page 3, if your getting there using a form then you gust need to put an hidden field in the form, like you've done for page 3, (can't page 2 & 3 be just one page). If your not posting the var from page two to page three then you can either: Hold it in a session var Hold it in a cookie Put it in a query string and grab it from $_GET[] save it to a file... Etc. It just depends on how your getting from page 2 to page 3 On 29/4/03 9:09 am, "Ron Allen" <allenro@firsthandcomm.com> wrote: > This is on the first page starting the query. > > <select name="SEARCH" onChange="document.inventorysearch.submit()"> > <OPTION>SELECT > <option>CAMP > <option>LIN > <option>NSN > <option>SERIAL > <option>DRAGON > <option>STATUS > </select> > > Second page > > <?PHP > $SEARCH = $_POST["SEARCH"]; > include 'drop.php'; > $DBName = "******"; > $table = "*****"; > $db = mysql_connect("$DBhost","$DBuser","$DBpass") or > die("Problem > connecting"); > mysql_select_db("$DBName") or die("Problem selecting database"); > $query = "SELECT * FROM $table"; > $result = mysql_query($query) or die ("Query failed"); > //let's get the number of rows in our result so we can use it in a for loop > $numofrows = mysql_num_rows($result); > ?> > > Third page > > <input type="hidden" name="SEARCH" value="<? echo $SEARCH; > ?>"> > > I have tried $SEARCH = $_POST["SEARCH"]; on the third page as well, but that > does not work. > > Any help would apprciated! > >

« previous php.general (#145596) next »