PDA

View Full Version : Sharing experiences about required fields



quyhurry
02-08-2006, 04:53 AM
Try with the simplest form to get a hand how to do it first.

I made the following pages:
-The main page with the form:
http://nguyenthaihocfoundation.com/test.html
-A Confirmation page:
http://nguyenthaihocfoundation.com/confirmation.html
-An error page:
http://nguyenthaihocfoundation.com/error.html

Then I downloaded the php zipfile from tutorial
http://www.vodahost.com/DemoDemo/bvt/custom_bluevoda_basicform.htm
Why? Because it's already a php file, I just have to delete the content and replace by this script:

<?php
// Receiving variables from the form
@$Name = addslashes($_POST['Name']);
if (strlen($Name) >40)
{
header("Location: error.html");
exit;
}
if (strlen($Name) == 0 )
{
header("Location: error.html");
exit;
}
//Sending Email to form owner
$pfw_header = "From: $email\n"
. "Reply-To: $email\n";
$pfw_subject = "testing";
$pfw_email_to = "your_Bluevoda_email (duyanhvq@nguyenthaihocfoundation.com)_address";
$pfw_message = "Name: $Name\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: confirmation.html");
?>
This is a script from Navaldesign that I have altered. Thank you Navaldesign :)

I saved it as test.php and uploaded it to the server using BlueFTP. That's it !
Please feel free to test it at:
http://nguyenthaihocfoundation.com/test.html
With or without putting a name on it

So the whole idea is there are 3 .html pages and 1 .php page.
The php page serves like a "navigator" to direct the form to confirmation or error.
If there are more required fileds, you need more error pages and the script must include new data.

At first glance, the script code could be intimiding but if you try to understand the meaning, it's not too tough to get it. Then you can alter it for your needs.
I am not a tech guy, at all, because my field is health care but I guess everybody can use their common sense to figure it out without much difficulties. So don't be afraid :) Go for it.
Hope this will help
Good luck to all
Quyhurry

J. Rusli
03-20-2006, 06:39 AM
You wrote... because it's already a php file, I just have to delete the content and replace by this script:
.....................
You wrote again...
This is a a script from Navaldesign that I have altered. Thank you Navaldesign:)
I ask...May I know; How to delete and replace it?
as I wanted to try but don't know where to start either.