Hi,
I'm trying to code a form that will call itself. The first time it is
called (by a link), it should display the empty form. If it was called by a
submit to itself, it will validate and then process or re-display the form
if it didn't pass validation.
In Programing PHP I found a technique (example 7-4.):
<?
$fahr = $_GET['fahrenheit'];
if (is_null($fahr)){ echo 'fahr is null';}
$>
The text says "we copy the form parameter value into $fahr. If we aren't
given that parameter, $fahr contains NULL.
I thought this could be used to create a value that would then be displayed
in the form field. If the parameter wasn't passed, the form field would be
empty. If the paramenter was passed, the value would be displayed. Like so:
<input name="temp" type="text" value="<?php echo $fahr; ?>" />
But when execute the code above I get an error: Notice: Undefined index:
fahrenheit in C:\Program Files\Apache Group\Apache2\htdocs\.........
Yet, the line 'fahr is null does print', so $fahr was successfully created.
Because I'm in debug mode, my error reporting is set to E_ALL. Are these
sorts of errors ones that will disappear when the error reporting threshold
is set lower. Should they be accepted in a development environment. Or is
there a better way of accomplishing what I want to do.
Thanks,
Linda
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php