...

View Full Version : new to HTML forms - help



akuria
06-08-2012, 01:02 AM
I am new to creating a HTML form where people fill out their Name, Email, and Message and that info gets emailed to me. Any help would be great. thanks.

felgall
06-08-2012, 04:03 AM
You need both the form in the HTML and a server side form2mail script to be able to do that.

akuria
06-08-2012, 06:00 AM
You need both the form in the HTML and a server side form2mail script to be able to do that.

i have a sendEmail.php script that I used with a HTML service in flex. I believe the script will work here to, right?


<?php
$senderName = $_POST['senderName'];
$senderEmail = $_POST['senderEmail'];
$senderComments = $_POST['senderComments'];
$sendType = $_POST['sendType'];
$sendToEmail = "jason@benedictumdesigns.com";

$recipient = "$sendToEmail";
$subject = "Web Contact: " . $sendType . " form";


$message = "
From: " . $senderName ." \n
Email Address: " . $senderEmail . "\n

Message: $senderComments\n
Interests: $senderInterests";

$headers = "From: " . $senderEmail;
$message = stripslashes($message);

mail($recipient, $subject, $message, $headers)
?>

williamxaviers
06-08-2012, 09:09 AM
Hi akuria, You have given perfect and very helpful information about Email.php script. this script very helpful for me because I am working as PHP developer last 6 month. So thanks for sharing this fantastic information.

Will Bontrager
06-08-2012, 04:02 PM
I see you have a script to process the form submission. That's good.

But you still need the form.

This is an excellent site to learn how to code forms: http://www.w3schools.com/html/html_forms.asp

And this, if you just need a simple form quickly, can help you generate form code: http://www.willmaster.com/create-form/

Use the PHP script as clues for naming the form fields. Form field name="senderName" for the name of the person filling in the form, for example.

I wish you the best. Coding can be a pleasure.

Will

akuria
06-08-2012, 10:57 PM
I see you have a script to process the form submission. That's good.

But you still need the form.

This is an excellent site to learn how to code forms: http://www.w3schools.com/html/html_forms.asp

And this, if you just need a simple form quickly, can help you generate form code: http://www.willmaster.com/create-form/

Use the PHP script as clues for naming the form fields. Form field name="senderName" for the name of the person filling in the form, for example.

I wish you the best. Coding can be a pleasure.

Will

Thanks for the info. I like the form generator you provided. also for for one site i want a more custom look.

felgall
06-09-2012, 02:03 AM
<?php
$senderName = $_POST['senderName'];
$senderEmail = $_POST['senderEmail'];
$senderComments = $_POST['senderComments'];
$sendType = $_POST['sendType'];


That part of the code is missing all the field validations and so someone would be able to run anything on your site simply by entering the appropriate entries into the form.

Each field should be validated prior to moving it out of the $_POST array. If someone enters invalid garbage into any field you should redisplay the form and ask them to fix it.

akuria
06-13-2012, 03:58 AM
That part of the code is missing all the field validations and so someone would be able to run anything on your site simply by entering the appropriate entries into the form.

Each field should be validated prior to moving it out of the $_POST array. If someone enters invalid garbage into any field you should redisplay the form and ask them to fix it.

sorry. still alittle new. how would i go about adding the validators. i have tried before and it never worked.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum