function not working after header call
| From: | Johannes Janson | Date: | Tue, 08 May 2001 15:30:12 +0000 |
| Subject: | function not working after header call | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51910@lists.php.net to get a copy of this message | ||
Hi,
I just don't get it...I have a form where the user enters name, surname
and a personal code. The action page checks for correct input which
is only letters for the two names and only numbers for the code.
If there is a wrong input in one of the fields a variable is set
which is then (amongst others) passed in the URL to the page containing
the form.
formscript.php?code=1&name=1&surname=1&...... // for all three fields wrong,
if they are ok they aren't passed
Now in order to highlight the fields with worng input I worte a
function.
function wrong_input($var)
global $var;
echo isset($var) ? "<font face=\"Times\" size=\"2\"
color=\"#FF0000\">" : "<font face=\"Times\" size=\"3\"
color=\"#000000\">";
}
This function is called in the <td> like this:
<td><?php wrong_input($code); ?>Code</font></td>
It is executed the first time but if the input is wrong and the user is sent
back to the form page it is not.
Desperately trying to get it to work I tried lots of combinations like using
print in the function or use
echo function($var) in the <td> but nothing worked out.
I'm completely stuck.
Any hlep is greately appreciated