Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
LinkBack Thread Tools
  #1  
Old 09-01-2007, 10:57 AM
Private
 
Join Date: Sep 2007
Posts: 2
Exclamation PHP Contact Form Validation

Hi there!

I'm developing my website with BlueVoda, and I added a "contact form" with a Thankyou.php page:

http://www.vodahost.com/DemoDemo/bvt..._basicform.htm

http://www.vodahost.com/vodatalk/44039-post5.html

So, my contact form & Thankyou page work perfectly, I receive the feedback from my visitors... the problem (there's always one, huh?) is that I need to "validate" the form, that is to say, to have a little piece of code able to check the three fields (name, email, comments) before sending me an empty email, to prevent what now happens: email account collapsed with empty emails...

I've tried to validate it through javascript, in the same page of the form, "contact.html", but it doesn't work... as soon as I click to send the form (through Thankyou.php, as action="Thankyou.php" and method="post"), the thankyou page processes an empty email to my account...

And I know nothing about php scripting, so I should not "touch" any code provided by BlueVoda & Forum Members working as is...

Can anyone help me, please...? I just need to stop empty emails collapsing my account with the same structure I have now (no more pages):

+ Contact.html (contains the basic form and sends it to process it through Thankyou.php)
+ Thankyou.php (contains the php code provided below and a Thank You message)

<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "myemail@mydomain.com";
$mailsubj = "Envío de Formulario de Contacto";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Valores enviados desde el formulario de contacto :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>

Thank you in advance and, please, forgive my english, I'm not an english native speaker!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 09-01-2007, 03:26 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,116
Default Re: PHP Contact Form Validation

There are two ways to validate fields:

1. Through javascript. However, you don't need to embedd external Javascripts. In your BV form, double click the fields, and select Validate. It will give you some options for validation, among them Required field, Custom error message , email address, etc.

2. Using ABVFP. It will perform php validation which cannot be overidden by users that have disabled Javascript in their browsers, and also has a lot of other features. Have a look at Advanced BlueVoda Form Processor
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 09-01-2007, 07:28 PM
Private
 
Join Date: Sep 2007
Posts: 2
Wink Re: PHP Contact Form Validation

First of all, I apologize for asking questions that could be answered just paying attention to a well done job... I mean the BlueVoda website builder, with its validating forms options...

Thank you, navaldesign,the first way (javascript in BV) was the (my) solution... The ABVFP is an option too "difficult" to my knowledges...

Thanks again!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 09-01-2007, 07:32 PM
navaldesign's Avatar
General & Forum Moderator
 
Join Date: Oct 2005
Location: Italy
Posts: 9,116
Default Re: PHP Contact Form Validation

Not a problem. You have just lost your patience for a moment LOL!!
__________________
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

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


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


All times are GMT +1. The time now is 05:44 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2007 VodaHost.com - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55