GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Need Help With Email Form Setup (https://gfy.com/showthread.php?t=601068)

BannerDept 04-22-2006 01:26 PM

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.

BannerDept 04-22-2006 01:46 PM

bump bump bump

SmokeyTheBear 04-22-2006 01:51 PM

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";
    }

    ?>


SmokeyTheBear 04-22-2006 01:53 PM

gfy fucks up the code

where it says hahaha the first time should say post

then the rest of the hahaha's should read ==

SmokeyTheBear 04-22-2006 01:57 PM

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";
    }

    ?>


SmokeyTheBear 04-22-2006 01:58 PM

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 )

BannerDept 04-22-2006 02:05 PM

hey thanks man, do you happen to have icq? Just have a quick question

Thanks again :)

SmokeyTheBear 04-22-2006 02:07 PM

yup its in my sig if you need some help


All times are GMT -7. The time now is 06:36 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123