RE: Condition for Adding data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, you're initializing $food to ""; then testing to see if it has a
value, which it never will.

If you're getting the $food variable from a POST or a GET op, you'll need to
grab it from the appropriate array,

$food = $_POST['food'];

echo $food;

to see what is being passed.



Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
"Pay It Forward"
mailto:gary.every@ingramentertainment.com
http://accessingram.com


> -----Original Message-----
> From: gatimu [mailto:gatimu@empserv.com]
> Sent: Tuesday, July 22, 2003 7:34 AM
> To: php-db@lists.php.net
> Subject:  Condition for Adding data
> 
> 
> 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
> 

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux