Closing Doman Auctions
DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars
HomeRegisterMembershipsGetting StartedDomain Tools Domain EbooksSEO Software Domain Resellers Advertise

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 02-11-2009, 10:21 AM   #1 (permalink)
No Avatar
 
Name: Andrew
Last Online: 11-04-2009 09:48 AM
iTrader: (104)
Join Date: Feb 2006
Posts: 2,810
DNF$: 550
Location: Canada
Country:


Sendmail.php help

I am building a simple contact form and wondering if i could get some help.

I want it to be a series of questions

form.html

<form method="post" action="sendmail.php">
Name: <input name="name" type="text" /><br />
Email Address: <input name="email" type="text" /><br />
Question 1:<br />
<textarea name="q1" rows="15" cols="40">
</textarea><br />
Question 2:<br />
<textarea name="q2 rows="15" cols="40">
</textarea><br />
<input type="submit" />
</form>


what does the sendmail.php have to look like i am having trouble getting this to work. i have tried a few things.

<?php
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$q1 = $_REQUEST['q1'] ;
$q2 = $_REQUEST['q2'] ;

mail( "my@emailaddress.com", "Feedback Form",
$message, "From: $email" );

?>


Thanks in advance
amcdonald is offline   Reply With Quote
Sponsored Ads
Old 02-11-2009, 11:27 AM   #2 (permalink)
.scot
 
ftaylor's Avatar
 
Name: Finbarr Taylor
Last Online: 10-25-2009 07:35 PM
iTrader: (4)
Join Date: Apr 2008
Posts: 468
DNF$: 4,244
Location: Glasgow
Country:


Your form method is "post". This means that all data passed by the form to sendmail.php will be in the $_POST array.

Try

Code:
$name = $_POST['name'];
further, if this is to be used on a live/production website, sendmail.php should NOT be as simple as that - you will have to sanitize and validate all of the user entered data.
__________________
GlasgowSEO.com is on auction on Sedo! Rank 2 on Google for 'glasgow seo'. CPC £3.35/$5.31. High advertiser competition. Glasgow is Scotland's largest city with over 1,000,000 inhabitants.
ftaylor is offline   Reply With Quote
Old 02-11-2009, 11:30 AM   #3 (permalink)
No Avatar
 
Name: Andrew
Last Online: 11-04-2009 09:48 AM
iTrader: (104)
Join Date: Feb 2006
Posts: 2,810
DNF$: 550
Location: Canada
Country:


Quote:
Originally Posted by ftaylor View Post
Your form method is "post". This means that all data passed by the form to sendmail.php will be in the $_POST array.

Try

Code:
$name = $_POST['name'];
further, if this is to be used on a live/production website, sendmail.php should NOT be as simple as that - you will have to sanitize and validate all of the user entered data.

Thanks, i will give that a shot. this form will be in a protected area of a website with a few trusted people having access.

Thanks,
amcdonald is offline   Reply With Quote
Old 02-11-2009, 11:40 AM   #4 (permalink)
.scot
 
ftaylor's Avatar
 
Name: Finbarr Taylor
Last Online: 10-25-2009 07:35 PM
iTrader: (4)
Join Date: Apr 2008
Posts: 468
DNF$: 4,244
Location: Glasgow
Country:


Feel free to PM me with any other PHP (and web tech) related questions - I'd be happy to help.
__________________
GlasgowSEO.com is on auction on Sedo! Rank 2 on Google for 'glasgow seo'. CPC £3.35/$5.31. High advertiser competition. Glasgow is Scotland's largest city with over 1,000,000 inhabitants.
ftaylor is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 -5. The time now is 09:20 PM.
Copyright @2001-2009 DNForum.com