You are here: Newbie Question: How to prevent sending blank form Script here. « PHP Language « IT news, forums, messages
Newbie Question: How to prevent sending blank form Script here.

Posted by tea-mad brit on 10/17/02 11:37

I have an html form which goes to this script. It works, but I want to
prevent the form input being sent unless some of the input fields have data.
The reason is so that people don't submit blank forms by accident (which
triggers a counter, not shown here). I got this from a beginners book and
modified it.
How do I check for valid input? I tried putting <input type="hidden"
name="required" value="name,email,phone,organization"/> into my input html
form but it doesn't do anything. Thanks for your help. I don't know much.

<?php
$to .= "myemail";
$subject = "Web Response";
/* print "Name: $name <br />\n";
print "Email Address: $email <br />\n";
print "Phone: $phone <br />\n";
print "Title: $title <br />\n";
print "Organization: $organization <br /><br />\n";
print "Comments: $comments \n"; */

$message = "Contact Info: \n
Name: $name \n
Email: $email \n
Phone: $phone \n
Title: $title \n
Organization: $organization \n
Street: $street \n
City: $city \n
State: $state \n
Zip: $zip \n
Comments: $comments \n";


mail ($to, $subject, $message);

?>

--
Christopher
www.teamadness.com
slightly true stories of tea drinking

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация