Need help to create a simple php form

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
CesarePlay
Registered User
Posts: 10628
Joined: 26 Mar 2007, 02:00
Location: In the river of thoughts
Contact:

Need help to create a simple php form

Post by CesarePlay »

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?
Image
RevQ
Registered User
Posts: 22
Joined: 23 Aug 2006, 02:00

Re: Need help to create a simple php form

Post by RevQ »

What is it you want the form to do? Go into a database or fire an email off?
CesarePlay
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

Post by CesarePlay »

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’] ;
Image
RevQ
Registered User
Posts: 22
Joined: 23 Aug 2006, 02:00

Re: Need help to create a simple php form

Post by RevQ »

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);
?>
Simply change the abc@123.co.za to the address you want it to send to and that should be good :D
CesarePlay
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

Post by CesarePlay »

RevQ wrote:

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);
?>
Simply change the abc@123.co.za to the address you want it to send to and that should be good :D
Ok. Thanks.
Image
Post Reply