![]() |
|
#1
|
|||
|
|||
|
what i am looking to accomplish:
i have a simple form where a user enters their email and clicks submit.. what i need is 1 php file that sends me an email containing their email address.. it doesn't need to give a thank you message or anything, just clear the box after submitting. it can have like a popup box saying something like "Thank you, your email address has been submitted."
__________________
Former owner/designer of a mafia game that i closed down after 7 years. i also do the following: can fix most photos (wallets, 8x10, etc..)... can code in vb 6.0... html and some css... made a couple of Nintendo DS games and working on more... i want to learn php eventually... Last edited by maximillion; 06-28-2011 at 07:11 PM. |
|
#2
|
|||
|
|||
|
Code:
<?php
$theiremail = $_REQUEST['email'];
$to = 'youremail@live.com';
$fields = array();
$fields{"email"} = "Email";
$body = "\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %
s\n",$b,$_REQUEST[$a]); }
$headers2 = "From: $theiremail";
$subject2 = "Someone contacted you";
$autoreply = "".$theiremail."";
if($theiremail == '') {print "You have not entered an email, please go
back and try again";}
else {
$send = mail($to, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://www.site.com/thanks" );}
else
{print "We encountered an error, please notify
webmaster@YourCompany.com"; }
}
?>
Last edited by ruletka; 06-28-2011 at 07:52 PM. |
|
#3
|
|||
|
|||
|
cool, i'll have to test it out.. ty :)
__________________
Former owner/designer of a mafia game that i closed down after 7 years. i also do the following: can fix most photos (wallets, 8x10, etc..)... can code in vb 6.0... html and some css... made a couple of Nintendo DS games and working on more... i want to learn php eventually... |
|
#4
|
|||
|
|||
|
didn't work on zymic hosting.. i'll have to try it on another host later today.
__________________
Former owner/designer of a mafia game that i closed down after 7 years. i also do the following: can fix most photos (wallets, 8x10, etc..)... can code in vb 6.0... html and some css... made a couple of Nintendo DS games and working on more... i want to learn php eventually... |
|
#5
|
||||
|
||||
|
Quote:
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
__________________
https://gemnode.com Free Hosting for Mysidia Adopt Sites Just join our forum and request your free hosting account |
|
#6
|
||||
|
||||
|
umm Nemisis...
I dont think it makes any differences by switching to a different host, but its just me.
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
|
#7
|
|||
|
|||
|
i don't think script actually works.. and i'm sure it wasn't even tested before being posted... but at least ruletka tried
__________________
Former owner/designer of a mafia game that i closed down after 7 years. i also do the following: can fix most photos (wallets, 8x10, etc..)... can code in vb 6.0... html and some css... made a couple of Nintendo DS games and working on more... i want to learn php eventually... |
|
#8
|
||||
|
||||
|
I found my favorite contact form tutorial though in obscuro, there is one other I like at CSS Tricks (great site that one, another that I really recommend is Girls Who Geek (used to be Tutorialtastic and CodeGrrl)).
__________________
|
|
#9
|
|||
|
|||
|
cool.. ty - but ii just wanted a pre-made script ready for use with just the email and submit
__________________
Former owner/designer of a mafia game that i closed down after 7 years. i also do the following: can fix most photos (wallets, 8x10, etc..)... can code in vb 6.0... html and some css... made a couple of Nintendo DS games and working on more... i want to learn php eventually... |
|
#10
|
||||
|
||||
|
The one at CSS Tricks is downloadable, it's just in a neat container. :3 Maybe taking a look at it will make it easier to modify?
__________________
|
![]() |
|
|
What's New? |
What's Hot? |
What's Popular? |