Does anyone have any idea what I'm doing wrong with this string?
The first portion of the code is :
// Check for a first name.
if (eregi ("[[:alpha:].' -]{2,30}$", stripslashes(trim($POST['first_name'])))) {
$fn = escape_data($POST['first_name']);
} else {
$fn = FALSE;
}
That is successful.
The following portion is in the field of the form.
<?php
if (isset($POST['first_name'])) echo $POST['first_name']; ?>
That is successful.
Now if I try to add this and I get the error message.
<?php
if { (isset($POST['first_name'])) echo $POST['first_name'];
}
else {
$fn = FALSE;
echo 'Please enter your first name.'; } ?>
The error message is:
Parse error: parse error, expecting `'('' in /usr/local/4admin/apache/vhosts/printxpress.us/httpdocs/sign-in.php on line 278
My goal is to have the error message appear in the field where the error has occured.
I'd also like the color the message itself to be in red, but haven't been able to figure that out at all. It just gets ugly when I add add:
<?php
if { (isset($POST['first_name'])) echo $POST['first_name'];
}
else {
$fn = FALSE;
echo '<font color="red" size="+1">Please enter your first name.'; } .</font> ?>
Advance Thanks, Jake