Re: POST question

From: Date: Sat, 20 Jul 2002 12:24:06 +0000
Subject: Re: POST question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108655@lists.php.net to get a copy of this message
> From: Mike Tuller <php@ce.anoka.k12.mn.us> > > I have a page with a form that has a drop down menu that I can select > different items that I want to display on another page where I can add more > information to be entered into a database. I can do that by using this on > the page that displays. > > while ($row = mysql_fetch_array( $sql_result )) > { > $_POST["asset_type"] = $row["asset_type"]; > } > > What I want to do is have a different page display for different choices. So > if I choose one type of asset to add, then submit it to be added to the > database, I want to have a script that reads what the selection was and > displays the page that matches the type of asset that matches it. > > I think the best way to do this is to have the "$_POST["asset_type"]" go to > a second page that decides if $_POST["asset_type"] = "Computer" go to the > page for adding computer information, or if it equals "Printer" is goes to > the page for entering printer information. The question I have is how can I > make sure the $_POST["asset_type"] carries onto a third page and how do I > make it so that when a selection is made, it opens the correct third page? > I think you could do this with just two pages. Set the action of the form on the first page to be the URL of the second page. Make the form displayed on the second page dependent on the value passed from the first page -- the value being the selection made from the drop down menu. Let the form(s) on the second page do all the database submission. -- Lowell Allen

« previous php.general (#108655) next »