Irish SEO,  Marketing & Webmaster Discussion

 

Submit Email Form

This is a discussion on Submit Email Form within the Coding Help forums, part of the Webmaster Help category; hi cormac, willing to learn eh? have a look at the below code, its a 'form' which will sit on ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 15-12-2006, 08:04 AM
7aken's Avatar
Frontpage User
 
Join Date: Oct 2006
Posts: 23
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
7aken will become famous soon enough
Default

hi cormac,

willing to learn eh? have a look at the below code, its a 'form' which will sit on your webpage first, then the php file that makes the magic! its very straighforward but its a start, you can just copy and paste this code if you want but i suggest you try to understand whats happening. i'll try to comment it as much as i can to help you understand

first, this code is the form which you place wherever you want on your webpage

HTML Code:
<form method="post" action="mailer.php"><br /> <!-- note the name of the php file -->
<input type="text" name="name" size="20"> <br />
Your Name<br />
<input type="text" name="email" size="20"><br />
 Email Address<br />
<input type="submit" name="submit" value="submit"></form> 
next is your php file which in this case we called mailer.php

PHP Code:
<?php 
if(isset($_POST['submit'])) { //checks to sit if submit button has been used
$to "you@you.com";    //enter the email address that you want info sent to here
$subject "newsletter signup"//email subject 
$name_field $_POST['name']; //retrieves users name
$email_field $_POST['email']; // retrieves users email address

$body "From: $name_field\n E-Mail: $email_field\n "
  
echo 
"You have signed up for our Newsletter!"
mail($to$subject$body);
} else { 
echo 
"There appears to be an error. please try again ";

?>
and there you have it, its very basic and doesnt redirect users back to the same page but you can figure that bit out yourself!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12 (permalink)  
Old 15-12-2006, 10:56 PM
Hardcore Geek
 
Join Date: Aug 2006
Location: Dublin
Posts: 1,048
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Gavin has a spectacular aura about
Default

Brilliant! Cheers for this, I'll give it a shot this weekend.
__________________

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13 (permalink)  
Old 20-12-2006, 10:57 AM
paul's Avatar
ninja SEO
Recent Blog: That SEO contest
 
Join Date: Dec 2006
Location: .de
Posts: 1,120
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
paul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud of
Default

have a look at this
Mr. D's Free PHP Contact Us Script

I've found it to be the best at what it does, in includes a basic image CAPTHCA and checks the referring source and other fancy bits. I had to do this when I got some funny mail program trying to pass weird strings to my less advanced script.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
email, form, submit

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
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Email Marketing Software / Services blacknight Email Marketing 7 06-11-2008 10:46 AM
Newbie to Email Marketing Fintan Email Marketing 5 20-01-2008 02:26 PM
Email marketing compared to direct marketing. JCB Email Marketing 27 10-09-2007 08:45 PM
Website not sending email to own domain cmccar Server / Technical Administration Tips and Queries 5 05-10-2006 06:58 PM
prevent mass email louie Coding Help 2 08-07-2006 09:34 AM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 01:30 PM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0