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

What's best way to get a user's Word doc converted to simple html and images?
Hi all,

I was just wondering if anybody has any experience of this.
Basically, I'm buildin

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

mysql select query problem
how can i select multiple fields from multiple table in one query like

i have table name t1 a

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

What is SAP Avatar ?
Hi All,

This G.Satish , my boss asked me to explore on SAP Avatar. I searced in internet

Word filter problem
Hello,

im trying to make a filter for words inputted in to my website but i want to store the

Combining refCursors and Summing
Given the following DDL:

CREATE TABLE FOODSALESTEST ("WEEKNBR" NUMBER, "ST

Which PHP-Editor do you think is the best?
Hi everyone,
Myself Brian Anderson. For the last 2 years i have been working a

How do I get the row number from from an sql table query
Hi all

I have a table that I query and it returns a number of rows.
mysql_num_rows($query)

Parse multirow HTML table
Hello all,
I have a site I am working on. Its a sports site and I am trying to add stats to a DB

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