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

fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw

Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment

Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site usi

strptime() equivalent for php4 ?!
Greetings!

this is my first post, thank you in advance for your replies.

Well, the ti

Not connecting to DB using ruby, error:env.c:257:in oci8lib.so: ORA-12154:
Hi All,

I am trying to connect to the database server from the client server using ruby and f

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

shift numbers with paging
Hi

How would i be able to display 10 numbers 1 2 3 4 5 6 7 8 9 10
and when I click next

PHP Directory Listing Not working
Hey Guys,

I need help, I tried a ton of directory listing scripts and they all don't work. Al

Form submissing with PHP and JQuery/Ajax
I have searched everywhere, but cannot find a solution for this... I have worked all day trying to g

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