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 == "") {
Did you know?Explore Trending and Topic pages for more stories like this.

.
. 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

Creating Images from images in PHP
Okay well I am trying to make a 'dynamic' calender image with PHP.

I have images like this:

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug

Production of mango in processing industry
Hi,

We have one scenario ,company is in process industry,they are manufacturing MANGO pul

Load Animated Image while cache is serve
I have a page that loads up using cache and took about 1 to 2 minutes before it loads to the page. <

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

Socket Server Response Headers
Earlier I had a post about my Socket Server, I wasn't able to get it to connect, now I can

I

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

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