Re: problems with self referential sticky forms
| From: | Mark Rees | Date: | Wed, 20 Jul 2005 08:41:56 +0000 |
| Subject: | Re: problems with self referential sticky forms | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219029@lists.php.net to get a copy of this message | ||
"eoghan" <php@redry.net> wrote in message
news:24A4AA20-7196-4DDD-BD92-60FB93C6DFE9@redry.net...
> On 20 Jul 2005, at 02:22, Linda H wrote:
>
> > fahreheit is here:
> >
> > <?
> > $fahr = $_GET['fahrenheit'];
> > if (is_null($fahr)){ echo 'fahr is null';}
> > $>
> >
> > The error was on the line: $fahr = $_GET['fahrenheit'];
>
> try:
> <input name="fahrenheit" type="text" value="<?php echo $fahr;
> ?>" />
Do as previously suggested and check that
$fahr=isset($_GET['fahrenheit'])?$_GET['fahrenheit']:null;
(although since you are dealing with a string here, perhaps an empty string
''might be a better bet than null)
then your test is
if($fahr==''){echo 'fahr is empty');
note the semicolon at the end of each line, and your closing php tag should
be ?>, not $>