Re: Passing variables through a page

From: Date: Sun, 05 Jan 2003 22:16:41 +0000
Subject: Re: Passing variables through a page
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-24575@lists.php.net to get a copy of this message
Alex Francis <afrancis@camerondesign.co.uk> wrote: > I have a page (dept_select) with two drop down lists populated from a table > in a MySQL Database. If one item is selected in either of the lists I need > to go to one page (5-14_select_area.php). If any other item is selected I > need to go to another page (add_new_resources.php) but I need to pass the > selected items to add_new_resources.php. I don't think there are many other possiblities, at least if you don't want to use JavaScript (and I hope you don't). Instead of the redirect, you could perhaps use require() to include one of the two possible pages, and thus avoid one server-client roundtrip. > At the moment I have created a page between dept_select.php and the other > pages and added the following code to it: > <?php > if ($department=="5-14 Curriculum") > { > header("Location:5-14_select_area.php"); > } > elseif ($level=="5-14 Curriculum") > { > header("Location:5-14_select_area.php"); > } > else > { > header("Location:add_new_resources.php"); > } > ?> The Location header requires an absolute URI, e.g. http://your_host/path/your_file.php. I'm not sure whether this is a database question ;-) Regards... Michael

« previous php.db (#24575) next »