Re: POST question

From: Date: Sat, 20 Jul 2002 05:58:25 +0000
Subject: Re: POST question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108622@lists.php.net to get a copy of this message
Ok, in the first page you create the select input with the results from the DB, the you submit the form to a second page, now, you have to check the value of the data sent in this page and then redirect the browser to the correct page, maybe you can use a switch like: switch($_POST["asset_type"]){ case 'Computer':
    header("Location: computer.php");
    break;
case 'Printer':
    header("Location: printer.php");
    break;
} etc. I hope I understood your question. At 12:39 a.m. 07/20/2002 -0500, you wrote:
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 hope I explained this well enough to understand. Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#108622) next »