Error Messaging not working


Posted on 16th Feb 2014 07:03 pm by admin

I changed the way my form tells the user of an error. But I can't seem to get it to work properly. Any help would be great. Thanks.

Code: // IF NO errors process form
if ($error == "") {

.
. code to email form
.
}
else {
// List errors
echo '<p class="error">'$error'</p>';
$output_form = true;
}
Error messages look like this..

Code: if (empty($first_name) && empty($last_name)) { // IF first and last are empty - REQUIRED FIELD
$error .= 'Please input your FIRST NAME and LAST NAME.<br />';
$output_form = true;
}

if (empty($first_name)) { // IF first only is empty - REQUIRED FIELD
$error .= 'Please input your FIRST NAME.<br />';
$output_form = true;
}

No comments posted yet

Your Answer:

Login to answer
176 Like 23 Dislike
Previous forums Next forums
Other forums

help me fix these syntax errors...
I keep getting multiple syntax errors on this script like this one:

Parse error: syntax error

Add User script "Could not execute query"
This should be an easy script but I can't get it to run. Can someone please help me?

<

Curly Bracket Delimeters.
I'd always believed that the starting and ending delimeters in preg_ functions had to be the same ch

Pulling out some result data from MYSQL
Hey Guys,

I've built a PHP page that has a for just imagine something like registration form

Problems with adding a link to one position in a 'foreach' loop, please help
Hello!

Iam pretty new to programming and I wanna create a table with users from an array. It

How do i do multi uploads?.
Hey i would like to do this : http://hosting.mrkrabz.net/

I've got the base down you can uplo

Is it possible to stop reservation creation in PM Order?
Hi All,

Is it possible to stop reservation creation in PM Order?

Thanks in adv

change text color with a jQuery code
Hihow can I change the text in a asp:TextBox to a different color when I start typing using jQuery?I

please hep to get values from a table row
can anyone tel me how I can select and get data from one row by pressing an Edit button in that row

How a counter of users ? such as ---> (231 Viewing)
I want to count how many users are actually viewing the page, How is that possible?
Thank you guy

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash