So my Page looks soemthing like this
<?php
$food=""; //Variable that will will determine which page to load)
if($food=="Milk")
{
$pgload="dairy/dairy.php";
}
if ($food=="eggs")
{
$pgload=poultry/poultry.php;
}
if ($sector=="ham")
{
$pgload=both/swine.php;
}
?>
<form name="appForm" method="post" action=.$pgload.>
// the variable $pgload will place the page to be
loaded
<select name="sector">
<option value="Milk">Milk Products</option>
<option value="Eggs">Egg Products</option>
<option value="Ham">BreakFast</option>
</select>
</form><
use this code and it should work:
<?php $pgload=''; // so that nobody can do cramp if register_globals is on switch($food) // see http://www.php.net/switch { case 'milk': $pgload="milk.php"; break; case 'egg': $pgload="egg.php"; break; case 'ham': $pgload="ham.php"; break; } echo '<form name="appForm" method="post" action='.$pgload.'">'; ?>
hope this helps (hth) .ma
e: [EMAIL PROTECTED] w: http://www.abendstille.at
# life would be easier if i knew the source code
Am Dienstag, 22.07.03 um 14:34 Uhr schrieb gatimu:
Hi
I need help!, I am quite new to php and I am trying to create a condition that will load a specific page after a form has been submitted to enter data in my database, I have tried using this code (I created it) but it wont work, all I get is a messege on the browser that says "the page address incorrect"
Here is how i have scripted the code <?php $food=""; if($food=="milk") { $pgload="milk.php"; } if ($food=="eggs") { $pgload="egg.php; } if ($food=="ham") { $pgload="ham.php"; } echo "<form name=appForm method=post action=.$pgload.>" ?>
any ideas on how i can go around this problem?
Gatimu
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
