RE: [PHP-DB] Condition for Adding data
| From: | Gary dot Every at ingramentertainment dot com | Date: | Tue, 22 Jul 2003 14:43:23 +0000 |
| Subject: | RE: [PHP-DB] Condition for Adding data | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-29400@lists.php.net to get a copy of this message | ||
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: [PHP-DB] 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
>