|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Apr 2006
Posts: 511
|
Need Help With Email Form Setup
Looking for links/tutorials on setting up an email form on my website, that allows people to fill in their subject, email address, message and submit it to me...using my email server.
Any help would be greatly appreciated. Thanks. |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Apr 2006
Posts: 511
|
bump bump bump
|
|
|
|
|
|
#3 |
|
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
save this as email.php then go to it..
Code:
<?php
$fileLocation = $HTTP_SERVER_VARS["PHP_SELF"];
$fileName = basename ($fileLocation);
$notcomplete = false;
$nodata = false;
if ( !isset($_POST["mailto"]) ) {
$nodata = true;
}
if ( !isset($_POST["subject"]) ){
$nodata = true;
}
if ( !isset($_POST["email"]) ){
$nodata = true;
}
if ( !isset($_POST["name"]) ){
$nodata = true;
}
if ( !isset($_POST["message"]) ){
$nodata = true;
}
if ($nodata){
?>
<center><h1>Anonymail</h1>
<form action="<?=$fileName?>" method=hahahahahaha>
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
Name:<br><input type="text" value="Your Name" name="name" size="20"><br>
Email:<br><input type="text" value="[email protected]" name="email" size="20"><br>
Subject:<br><input type="text" value="Your Subject" name="subject" size="20"><br>
Send to:<br><input type="text" value="[email protected]" name="mailto" size="20"><br>
Message:<br><textarea name="message" cols="30" rows="6"></textarea><br>
<input type="submit" name="submit" value=" Send "></td></tr></table></form>
<?php
exit("");
}//end if nodata
if ( trim($_POST["mailto"] hahahaha "") ){
$notcomplete = true;
}
if ( trim($_POST["subject"] hahahaha "") ){
$notcomplete = true;
}
if ( trim($_POST["email"] hahahaha "") ){
$notcomplete = true;
}
if ( trim($_POST["name"] hahahaha "") ){
$notcomplete = true;
}
if ( trim($_POST["message"] hahahaha "") ){
$notcomplete = true;
}
if ($notcomplete){
echo "missing required parameter";
//you could change the a
exit ('a href="javascript:history.back(1)"> click here a');
}
$mailto = $_POST["mailto"];
$email = $_POST["email"];
$subject = $_POST["subject"];
$message = $_POST["message"];
$name = $_POST["name"];
//$mailto = "$mailto";
//$subject = "$subject";
$msg = ereg_replace("\\\'", "'", $message);
$msg1 = ereg_replace('\\\"', "\"", $msg);
$message1 = "From: $name\nemail: $email\nmessage:\n$msg1";
$sent = mail($mailto, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
if ($sent){
echo ("Your Email has been sent to $mailto!");
}else{
echo "Message sending Failed";
}
?>
__________________
hatisblack at yahoo.com |
|
|
|
|
|
#4 |
|
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
gfy fucks up the code
where it says hahaha the first time should say post then the rest of the hahaha's should read ==
__________________
hatisblack at yahoo.com |
|
|
|
|
|
#5 |
|
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
Code:
<?php
$fileLocation = $HTTP_SERVER_VARS["PHP_SELF"];
$fileName = basename ($fileLocation);
$notcomplete = false;
$nodata = false;
if ( !isset($_POST["mailto"]) ) {
$nodata = true;
}
if ( !isset($_POST["subject"]) ){
$nodata = true;
}
if ( !isset($_POST["email"]) ){
$nodata = true;
}
if ( !isset($_POST["name"]) ){
$nodata = true;
}
if ( !isset($_POST["message"]) ){
$nodata = true;
}
if ($nodata){
?>
<center><h1>Anonymail</h1>
<form action="<?=$fileName?>" method="post">
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
Name:<br><input type="text" value="Your Name" name="name" size="20"><br>
Email:<br><input type="text" value="[email protected]" name="email" size="20"><br>
Subject:<br><input type="text" value="Your Subject" name="subject" size="20"><br>
Send to:<br><input type="text" value="[email protected]" name="mailto" size="20"><br>
Message:<br><textarea name="message" cols="30" rows="6"></textarea><br>
<input type="submit" name="submit" value=" Send "></td></tr></table></form>
<?php
exit("");
}//end if nodata
if ( trim($_POST["mailto"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["subject"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["email"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["name"] == "") ){
$notcomplete = true;
}
if ( trim($_POST["message"] == "") ){
$notcomplete = true;
}
if ($notcomplete){
echo "missing required parameter";
//you could change the a
exit ('a href="javascript:history.back(1)"> click here a');
}
$mailto = $_POST["mailto"];
$email = $_POST["email"];
$subject = $_POST["subject"];
$message = $_POST["message"];
$name = $_POST["name"];
//$mailto = "$mailto";
//$subject = "$subject";
$msg = ereg_replace("\\\'", "'", $message);
$msg1 = ereg_replace('\\\"', "\"", $msg);
$message1 = "From: $name\nemail: $email\nmessage:\n$msg1";
$sent = mail($mailto, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
if ($sent){
echo ("Your Email has been sent to $mailto!");
}else{
echo "Message sending Failed";
}
?>
__________________
hatisblack at yahoo.com |
|
|
|
|
|
#6 |
|
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
there you go , that should work
just make the "to" box hidden so they cant send email to anyone ( or alter the php to a set value )
__________________
hatisblack at yahoo.com |
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Apr 2006
Posts: 511
|
hey thanks man, do you happen to have icq? Just have a quick question
Thanks again |
|
|
|
|
|
#8 |
|
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
yup its in my sig if you need some help
__________________
hatisblack at yahoo.com |
|
|
|