Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old June 30th, 2009, 04:48 PM   #1
New Member
 

Join Date: May 2009
Location: uk
Age: 37
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 speed is on a distinguished road
Validating form fields

http://elitetradesmen.com/registration%20form.php?id=7

I'm trying to set up the above page so that the visitor has to complete certain fields. I've managed to make it so that the error message comes up for each field but now even if they complete the field the error message comes up. I'm guessing that i have to add some code at the bottom of my form which says if field completed etc etc but i don't know how to do this bit. What's the code i need?
I also have no idea how to post code in this forum so will just show the relevent bits.

if ($senders_name != "=")
{$error = "1";
$info_error .= $lang_noname . "<br>";}

if ($company != "=")
{$error = "1";
$info_error .= $lang_nocompany . "<br>";}

if ($senders_name != "=")
{$error = "1";
$info_error .= $lang_notrade . "<br>";}

if ($telephone != "=")
{$error = "1";
$info_error .= $lang_notelephone . "<br>";}

{
if ($checkdomain == "yes")
{
$sender_domain = substr($senders_email, (strpos($senders_email, '@')) +1);
$recipient_domain = substr($sendto_email, (strpos($sendto_email, '@')) +1);
if ($sender_domain == $recipient_domain)
{
print "Sorry, you cannot send messages from this domain ($sender_domain)";
exit;
}
speed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 2nd, 2009, 07:08 AM   #2
Reputable Member
 

Join Date: Mar 2009
Location: Spain
Posts: 179
Thanks: 0
Thanked 1 Time in 1 Post
Rep Altering Power: 0 GalaxyTramp has a spectacular aura about GalaxyTramp has a spectacular aura about
Re: Validating form fields

Hi

Having read this and your previous posts I rather think you are trying to take a short cut by asking members of the forum to code your page for you!

This may get the job done quickly if they are generous enough to do so, but at the end of the day you will end up with something that you simply do not understand the function of.

What you really should be doing is looking at perhaps increasing your understanding of PHP so that you can look objectively at the job in hand.

There are a good many examples and tutorials about forms on the web which will explain the how and why of their function.

The members of this forum will of course be happy to assist you when you encounter a problem, this is how many of us learnt in the first place. I feel sure that simply asking for someone to write the code for your page will not be seen as "assisting" you.

These are just my views on the situation and in no way meant to discourage you. There is a good feeling about creating your own PHP code that works and works well!

Regards

GT
GalaxyTramp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 3rd, 2009, 01:17 PM   #3
New Member
 

Join Date: May 2009
Location: uk
Age: 37
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 speed is on a distinguished road
Re: Validating form fields

I'm not asking for someone to write my code for me. All i needed to know was where i was going wrong and point me in the right direction. I've actually done what i wanted now by finding tutorials and adapting them to my page. The simple fact of the matter is that i just needed to get my site operational as quickly as possible so don't really have time to go into all the ins and outs of web design.

I do appreciate where you are coming from and i thank everyone for any help i've been given so far.
speed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with form - how to remember fields sing2trees PHP 4 January 6th, 2009 09:34 AM
Validating a Form aminah_azad JavaScript 0 October 14th, 2008 06:17 PM
Hiding / Showing form fields based on previous form input John Alexander Hopper PHP 1 March 10th, 2008 09:30 AM
Form Fields robukni PHP 7 October 10th, 2007 05:26 PM
FLASH - validating input fields if empty before clicking submit button kyutkb Flash and ActionScript 3 July 24th, 2007 12:38 PM


Search Engine Optimization by vBSEO 3.2.0 RC8