Form Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hoopster

    #1

    Form Help

    Here is my form that I''m having problems with.

    I just can't get an e-mail ???



    <p><b class="yellow"> Contact Us</b></p>
    <form action="FormToE mail.php" method="post"
    enctype="multip art/form-data">
    <input class="sidebar" value="name" name="user" >
    <input class="sidebar" value="email" name="email" > <TEXTAREA
    class=sidebar name=content rows=40 cols=30></TEXTAREA>
    <input class="button_s idebar" value="Send" type="submit" >
    <input class="button_s idebar" value="Reset" type="reset" >
    </form>





    My FormToEmail.php looks like this:


    <?php


    */

    $my_email ="Johndoe@gmail .com";

    /*

    Enter the continue link to offer the user after the form is sent. If
    you do not change this, your visitor will be given a continue link to
    your homepage:

    If you do change it, remove the "/" symbol below and replace with the
    name of the page to link to, eg: "mypage.htm " or
    "http://www.elsewhere.c om/page.htm"

    */

    $continue = "/";

    /*

    Step 3:

    Save this file (FormToEmail.ph p) and upload it together with your
    webpage to your webspace. IMPORTANT - The file name is case
    sensitive! You must save it exactly as it is named above! Do not put
    this script in your cgi-bin directory (folder) it may not work from
    there.

    THAT'S IT, FINISHED!

    You do not need to make any changes below this line.

    */

    // This line prevents values being entered in a URL

    if ($_SERVER['REQUEST_METHOD '] != "POST"){exi t;}

    // Describe function to check for new lines.

    function new_line_check( $a)
    {

    if(preg_match(' `[\r\n]`',$a)){header( "location:
    $_SERVER[HTTP_REFERER]");exit;}

    }

    new_line_check( $_POST['Name']);

    // Check for disallowed characters in the Name and Email fields.

    $disallowed_nam e = array(':',';',' "','=','(',')', '{','}','@');

    foreach($disall owed_name as $value)
    {

    if(stristr($_PO ST['Name'],$value)){heade r("location:
    $_SERVER[HTTP_REFERER]");exit;}

    }

    new_line_check( $_POST['Email']);

    $disallowed_ema il = array(':',';'," '",'"','=','(', ')','{','}');

    foreach($disall owed_email as $value)
    {

    if(stristr($_PO ST['Email'],$value)){heade r("location:
    $_SERVER[HTTP_REFERER]");exit;}

    }

    $message = "";

    // This line prevents a blank form being sent, and builds the message.

    foreach($_POST as $key =>
    $value){if(!(em pty($value))){$ set=1;}$message = $message . "$key:
    $value\n\n";} if($set!==1){he ader("location:
    $_SERVER[HTTP_REFERER]");exit;}

    $message = $message . "-- \nThank you for using FormToEmail from
    http://FormToEmail.com ";
    $message = stripslashes($m essage);

    $subject = "FormToEmai l Comments";
    $headers = "From: " . $_POST['Email'] . "\n" . "Return-Path: " .
    $_POST['Email'] . "\n" . "Reply-To: " . $_POST['Email'] . "\n";

    mail($my_email, $subject,$messa ge,$headers);

    ?>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>

    <head>

    <title>Form To Email PHP script from FormToEmail.com </title>

    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252">
    <meta http-equiv="Content-Language" content="en-uk">

    </head>

    <body bgcolor="#fffff f" text="#000000">

    <font face="arial">

    <object><center >
    <h1>Thank you <?php print stripslashes($_ POST['Name']); ?>!</h1>
    <h2>Your form has been sent</h2>
    <h3><a href="<?php print "$continue" ; ?>">Click here to
    continue</a></h3>
    <b>FormToEmai l</b> by <a
    href="http://FormToEmail.com ">FormToEmail.c om</a>
    </center></object>

    </font>

    </body>
    </html>










    ********** For some reason I just can't receive an e-mail.



    Any help would be appreciated.


    Thanks!

    - hoopster
  • Jerry Stuckle

    #2
    Re: Form Help

    Hoopster wrote:[color=blue]
    > Here is my form that I''m having problems with.
    >
    > I just can't get an e-mail ???
    >
    >[/color]
    <snip code>[color=blue]
    >
    > Thanks!
    >
    > - hoopster[/color]


    Yes, a few:

    1) Asking where you got the script
    2) Try to do a little debugging to see what's going on.
    3) Find out what code is failing
    4) If it's related to your host, see if this has been restricted by the host
    5) Don't multipost. Crosspost instead

    You're dealing with an external here - the hosting email program, as well as
    host settings. It would be very hard for anyone to tell you what your problem
    is from all this code.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    Working...