Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-08-2012, 12:02 AM   PM User | #1
akuria
New Coder

 
Join Date: Nov 2011
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
akuria is an unknown quantity at this point
new to HTML forms - help

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.
akuria is offline   Reply With Quote
Old 06-08-2012, 03:03 AM   PM User | #2
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
You need both the form in the HTML and a server side form2mail script to be able to do that.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 06-08-2012, 05:00 AM   PM User | #3
akuria
New Coder

 
Join Date: Nov 2011
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
akuria is an unknown quantity at this point
Quote:
Originally Posted by felgall View Post
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 Code:
<?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)
?>
akuria is offline   Reply With Quote
Old 06-08-2012, 08:09 AM   PM User | #4
williamxaviers
New Coder

 
Join Date: May 2012
Posts: 34
Thanks: 0
Thanked 2 Times in 2 Posts
williamxaviers is an unknown quantity at this point
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.
__________________
Benefit of indesign training
williamxaviers is offline   Reply With Quote
Old 06-08-2012, 03:02 PM   PM User | #5
Will Bontrager
Regular Coder

 
Join Date: Jun 2012
Location: Near Chicago, USA
Posts: 123
Thanks: 7
Thanked 19 Times in 19 Posts
Will Bontrager is an unknown quantity at this point
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
Will Bontrager is offline   Reply With Quote
Old 06-08-2012, 09:57 PM   PM User | #6
akuria
New Coder

 
Join Date: Nov 2011
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
akuria is an unknown quantity at this point
Quote:
Originally Posted by Will Bontrager View Post
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.
akuria is offline   Reply With Quote
Old 06-09-2012, 01:03 AM   PM User | #7
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by akuria View Post
PHP Code:
<?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.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 06-13-2012, 02:58 AM   PM User | #8
akuria
New Coder

 
Join Date: Nov 2011
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
akuria is an unknown quantity at this point
Quote:
Originally Posted by felgall View Post
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.
akuria is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:29 PM.


Advertisement
Log in to turn off these ads.