isset()
| From: | Daniel J. Rychlik | Date: | Sat, 14 Jun 2003 21:54:36 +0000 |
| Subject: | isset() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151520@lists.php.net to get a copy of this message | ||
Having a bit of trouble with my forms returnin 1 in the form fields accept the data that was
entered. I think its because of this line,
$output_fname = isset($HTTP_POST_VARS['fname']);
I have a command action handler also that works in the same script and it seems to work well, the
only problem that Im having is passing back the error to the related filed that requires proper
data. I started just passing back a generic message so that I could get the routine down, once I
get that I will be able to do more.
Here is a snipit of my code.
<head>
<?php if ($has_errors) { ?>
Please fix your errors
<?php foreach($errors as $val) {
echo $val; } ?>
<?php } else { ?>
Please fill out form.
<?php } ?>
<form .....
HTML STUFF.
</form>
<?php
if (count($errors)) $has_errors = true; // If we find errors, then flag
if ($has_errors) $command ="data_check" // Take us back to the data_check
hidden field and set $has_errors true to display our errors at the top
of our form.
?>
<head>
This is really a 2 question issue, and I greatly appreicate you're time. This is my 2nd week
learning PHP...
Thanks in advance,
Dan