Hi everyone. I need some help. I need to create a simple php script for a feedback form. The form contains subject, name, email and comments.
I have tried google but not finding the script I used before and I can't find my script. Can anyone help with this?
Need help to create a simple php form
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Need help to create a simple php form
What is it you want the form to do? Go into a database or fire an email off?
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Need help to create a simple php form
To fire an email off. I got it started but I have no idea how the rest of the script must look like. Here is what I got so far:
?php
$Subject = $_POST[‘subject’] ;
$Name = $_POST[‘name’] ;
$Email = $_POST[‘email] ;
$Comment = $_POST[‘comments’] ;
?php
$Subject = $_POST[‘subject’] ;
$Name = $_POST[‘name’] ;
$Email = $_POST[‘email] ;
$Comment = $_POST[‘comments’] ;
Re: Need help to create a simple php form
Code: Select all
<?php
$Subject = $_POST[‘subject’] ;
$Name = $_POST[‘name’] ;
$Email = $_POST[‘email] ;
$Comment = $_POST[‘comments’] ;
$headers = "From: ".$Name." <".$Email.">\r\n";
$headers.= "Reply-To: ".$Email."\r\n";
mail("abc@123.co.za",$Subject, $Comment,$headers);
?>
-
- Registered User
- Posts: 10628
- Joined: 26 Mar 2007, 02:00
- Location: In the river of thoughts
- Contact:
Re: Need help to create a simple php form
Ok. Thanks.RevQ wrote:Simply change the abc@123.co.za to the address you want it to send to and that should be goodCode: Select all
<?php $Subject = $_POST[‘subject’] ; $Name = $_POST[‘name’] ; $Email = $_POST[‘email] ; $Comment = $_POST[‘comments’] ; $headers = "From: ".$Name." <".$Email.">\r\n"; $headers.= "Reply-To: ".$Email."\r\n"; mail("abc@123.co.za",$Subject, $Comment,$headers); ?>