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

Why does this file not return file names that start with numbers?
This file returns a list of filenames to help populate a drop down in my form. For some reason it ig

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

How to file_get_contents when login required?
Hello!

I am trying to read data from a page that you have to be logged into to view, I am try

PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26

Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill t

Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
OK, I think but have a problem, only 1 pro

Local file browser with php
Halo..

So this is what i want to create. I have a folder that i share and it has many movies.

trouble printing an array....
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an arra

HTML Email rec'd as Source Code
The code does create and send the email successfully. However, the message shows as html code and n

frames get header location..
i have two frames, one top, one bottom. how do i do a form on the bottom frame that gives me the ur

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