Be a Supporter!

Email Form / Contact page

  • 2,109 Views
  • 5 Replies
New Topic Respond to this Topic
MihaS
MihaS
  • Member since: Jun. 4, 2005
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Email Form / Contact page Mar. 16th, 2006 @ 02:01 PM Reply

This is a Tutorial about making a Contact Page on your site using PHP
Ok so you hate spambots? So do I ! Making a contact page that doesent show your Email is a perfect solution!

Requirements :
- PHP 4.XX.XX
- Basic knowledge of HTML and PHP

So lets start. First if we dont have MySQL We make a file that will have our email!

include_email_info.php
<?php
$email = "myemail@myhost.com";
?>

Now we have our email written in a file.. So lets make the contact PHP page!
We will name it contact.php < duhh...

So: contact.php
<?php
//We include include_email_info.php so that we may acceas the email!
include_once("include_email_info.php");
// We check if variables are set!
if(isset($_POST['user_email'],$_POST['name
'],$_POST['meassege'])){

// If they are set. Set the text and filter the input thus send the email! If not, show the page...

$meassege = strip_tags($_POST['meassege']."\n\n".$_POS
T['name']);
mail($email,"Contact",$meassege);
echo "Email Sent!";
}
else
{
// So this is the boring part.. So im not going to write it.. Just echo your html code:
echo "<html>";
echo "<body>";
etc....
dont forget to name the <textarea type='text' name='meassege'> the inputs like the variables...
}
?>
Well hope it helped anyone!

citricsquid
citricsquid
  • Member since: Jun. 25, 2005
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to Email Form / Contact page Mar. 16th, 2006 @ 02:03 PM Reply

Hmm, i am just testing it out now, so ill post back if it works, but seems a good tutorial anyway, welldone. +10 cool points for you. Submit it to php:main if it hasn't been done before.

MihaS
MihaS
  • Member since: Jun. 4, 2005
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Email Form / Contact page Mar. 16th, 2006 @ 02:09 PM Reply

Ok tell me if sometin doesent work.. i will help you! :)

NinoGrounds
NinoGrounds
  • Member since: Nov. 28, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
thecoshman
thecoshman
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to Email Form / Contact page Aug. 8th, 2006 @ 08:27 AM Reply

ok, seems to be fairly simple to understand, jsut how do i actually use this code?

Do i use as a seprate file of code or somthing?

phyconinja
phyconinja
  • Member since: Sep. 18, 2004
  • Offline.
Forum Stats
Member
Level 25
Blank Slate
Response to Email Form / Contact page Nov. 19th, 2006 @ 05:52 AM Reply

At 3/16/06 02:03 PM, CitricSquid wrote: Hmm, i am just testing it out now, so ill post back if it works

does this mean its not working?
gonna use this now.
just what I was looking for. thanx