IPB

Welcome Guest ( Log In | Register )



Tags
This content has not been tagged yet
3 Pages V   1 2 3 >  
Reply to this topicStart new topic

Php Emailer/contact System

, An email or contact system for your site

maddog39
no avatar
Super Member
*********
Group: Members
Posts: 208
Joined: 27-January 05
From: LI, New York
Member No.: 3,448



Post #1 post Mar 7 2005, 11:28 PM
Hello all,

Here is an easy Emailer or Contact system that allows visitors or members of your site to email you just by filling out a form. So here is what you need to do to set it up.
First open up a new page in your text editor and paste in the following code.
CODE

<?php
$Name = $_POST['Name'];
$Subject = $_POST['Subject'];
$Email = $_POST['Email'];
$Site = $_POST['Site']; $Message=$_POST['Message'];
$align = $_POST['align'];
$to = "$EmailTo";
$subject = "$Subject";
$body = "$Message\n\n\n$Site\nBy: $Name";
$headers = "From: $Email\n";
mail($to,$subject,$body,$headers);
// After they've clicked "Send", this is where they are going... Change it to where you want them to go.
header("Location: sent.htm");
?>

then save this file as mailform.php
Next open up another new page in your text editor and paste in the following code.
CODE

<form action="mailform.php" method="post">
<input type=hidden name=EmailTo value="You@mail.com"> <!-- // Change to your email address // -->
Your Name: <input type=text name=Name><br>
Subject: <input type=text name=Subject><br>
Your Email: <input type=text name=Email><br>
Your Site: <input type=text name=Site><br>
Message: <br><textarea name=Message rows=6 cols=30></textarea><br>
<input type=submit value="Send"> <input type=reset value="Reset"></form>

then save that page as contact.htm
For the the last page, open up a new page in your text editor and paste in this code.
CODE

<p>Your message has been sent to the webmaster. You should recieve a reply shortly. </p>
<p><a href="index.php" target="_self">Go Back To Index?</a></p>

and then save that page as sent.htm
Upload all of the files to your server and your done.

*Also note that you can just take the code from 'contact.htm' and put it in another of your webpages on your site and do whatever you want with it but dont do anything with the other files or code unless you really know what your doing.

Comments are always appreciated and enjoy! wink.gif biggrin.gif
Go to the top of the page
+Quote Post
Dooga
no avatar
Moderator
Group Icon
Group: [MODERATOR]
Posts: 1,344
Joined: 26-December 04
From: Canada
Member No.: 2,940
myCENT:46.53



Post #2 post Mar 8 2005, 12:56 AM
Couldn't we also use the CGI bin? That would seem easier for me smile.gif
Go to the top of the page
+Quote Post
millertime
no avatar
It's Miller Time
********
Group: Members
Posts: 168
Joined: 8-February 05
Member No.: 3,672



Post #3 post Mar 8 2005, 03:02 AM
does this work for anybody or do you have to have certain things enabled in php on your server?
Go to the top of the page
+Quote Post
karlo
no avatar
Privileged Member
*********
Group: Members
Posts: 623
Joined: 30-October 04
From: Philippines
Member No.: 2,049



Post #4 post Mar 8 2005, 05:20 AM
QUOTE(jmiller87 @ Mar 8 2005, 11:02 AM)
does this work for anybody or do you have to have certain things enabled in php on your server?
[right][snapback]57422[/snapback][/right]

I think it will work on any server. Anyways, you can use some built-in scripts like form mailers in cPanel. I love your Avatar. Where did you get it?
Go to the top of the page
+Quote Post
mizako
no avatar
Super Member
*********
Group: Members
Posts: 372
Joined: 16-August 04
From: Spain
Member No.: 824



Post #5 post Mar 8 2005, 12:55 PM
Thanks, i was looking for something like this for a long time. I embedded your code and it seems to work perfectly on my site.
Go to the top of the page
+Quote Post
maddog39
no avatar
Super Member
*********
Group: Members
Posts: 208
Joined: 27-January 05
From: LI, New York
Member No.: 3,448



Post #6 post Mar 9 2005, 10:58 PM
Yes this script is completley self contained and it doesnt need anything special. I havnt seen any mailer scripts in cPanel. Plus perl scripts are a pain in the butt. I like my script alot better. biggrin.gif
Go to the top of the page
+Quote Post
GMTech
no avatar
Newbie [Level 2]
**
Group: Members
Posts: 39
Joined: 8-March 05
Member No.: 4,293



Post #7 post Mar 9 2005, 11:20 PM
That'd good, I will use it when I get my hosting, I'm still slowly making my way up there though... biggrin.gif
Go to the top of the page
+Quote Post
GM-University
no avatar
Super Member
*********
Group: Members
Posts: 287
Joined: 23-February 05
Member No.: 3,945



Post #8 post Mar 10 2005, 12:43 AM
Wow, nice scripts, I too will use them when my hosting is renewed, I will have to try to find a nice purpose of course though, what kind of graphics are displayed with this, you should work on a version where you can add backrounds and stuff. Nice work! smile.gif
Go to the top of the page
+Quote Post
maddog39
no avatar
Super Member
*********
Group: Members
Posts: 208
Joined: 27-January 05
From: LI, New York
Member No.: 3,448



Post #9 post Mar 10 2005, 09:24 PM
Theres nothing, just forms. But if I do-do something fancy it will be copyrighted and stuff. I will have restrictions to and it will be under the GPL lisence like my other PHP Programs. biggrin.gif
Go to the top of the page
+Quote Post
karlo
no avatar
Privileged Member
*********
Group: Members
Posts: 623
Joined: 30-October 04
From: Philippines
Member No.: 2,049



Post #10 post Mar 11 2005, 09:59 AM
QUOTE(maddog39 @ Mar 11 2005, 05:24 AM)
Theres nothing, just forms. But if I do-do something fancy it will be copyrighted and stuff. I will have restrictions to and it will be under the GPL lisence like my other PHP Programs. biggrin.gif
[right][snapback]58597[/snapback][/right]

Please, do explain your code!
Go to the top of the page
+Quote Post

3 Pages V   1 2 3 >
Reply to this topicStart new topic

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No new 20 BuffaloHELP 433 19th October 2008 - 01:41 AM
Last post by: BuffaloHELP
No New Posts   1 flashyflashy 738 1st August 2004 - 06:19 AM
Last post by: Florisjuh
No New Posts   2 georgewar 439 6th August 2004 - 03:33 PM
Last post by: Xenon
No New Posts   2 georgewar 381 4th August 2004 - 12:32 PM
Last post by: Spectre
No New Posts   10 ill 905 19th August 2004 - 01:29 PM
Last post by: odomike
No New Posts   0 DjLuki 905 4th July 2006 - 07:19 AM
Last post by: DjLuki
No New Posts   1 dundun2007 397 3rd September 2004 - 02:24 AM
Last post by: serverph
No New Posts   6 Critical_Impact 436 10th September 2004 - 07:20 PM
Last post by: groentjuh
No New Posts   5 Critical_Impact 396 11th September 2004 - 12:19 AM
Last post by: Critical_Impact
No new 21 googlue 2,007 10th December 2004 - 11:47 AM
Last post by: antitrust


 



RSS Lo-Fi Version Time is now: 3rd December 2008 - 07:59 PM