Re: Help please: undefined index in sample code
| From: | Stephen | Date: | Sat, 14 Jun 2003 09:26:52 +0000 |
| Subject: | Re: Help please: undefined index in sample code | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20309@lists.php.net to get a copy of this message | ||
Which just goes to show some people will say anything...
I don't think this has anything to do with register globals (Sorry toby).
Undefined index sounds like php is just warning you that you are using a
variable without a value. Since you are using a form to send data, this can
occur. To be honest, its a fairly pointless warning, so you probably want to
ignore it. In your php.ini file search for and find the
error_reporting
option. I recommend you change your settings to
error_reporting = E_ALL & ~E_NOTICE
This should solve your problem.
----- Original Message -----
From: "Stuart Felenstein" <stuart4m@yahoo.com>
To: <php-windows@lists.php.net>
Sent: Saturday, June 14, 2003 10:18 AM
Subject: Re: [PHP-WIN] Help please: undefined index in sample code
> Yes, register globals are now on. Though it doesn't apparently matter.
>
> Stuart
>
> toby z <blue_myth_1@yahoo.com> wrote:
> register globals on or off ?????
>
> --- Stuart Felenstein wrote: > I can't believe
> Chapter 1 , section 1 and I'm off to a bad start
> > already.
> > Using this form and script, I keep getting "undefined index" for
> > the variables I declare in the script. Running PHP 4.3.2 on XP
> > Pro. Thanks.
> > Stuart
> >
> > Form:
> >
> >
> >
> >
> > Item
> > Quantity
> >
> >
> > Tires
> > [input] > maxlength="3">
> >
> >
> > Oil
> > [input] > maxlength="3">
> >
> >
> > Spark Plugs
> > [input] > maxlength="3">
> >
> >
> > [input] > Order">
> >
> >
> >
> >
> > Script:
> >
> >
> >
> >
> >
> >
> > Bob's Auto Parts
> > Order Results
> > > //create short variable names
> > $tireqty = $_POST['tireqty'];
> > $oilqty = $_POST['oilqty'];
> > $sparkqty = $_POST['sparkqty'];
> > ?>
> > > echo '
> Your order is as follows:
> ';
> > echo $tireqty.' tires
> ';
> > echo $oilqty.' bottles of oil
> ';
> > echo $sparkqty.' spark plugs
> ';
> > ?>
> >
> >
> >
>
> ________________________________________________________________________
> Want to chat instantly with your online friends? Get the FREE Yahoo!
> Messenger http://uk.messenger.yahoo.com/