Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Form help

  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form help

    I have been having trouble with my form.

    Here is what I have for my contact page...
    PHP Code:
    <h3>Contact</h3><p>
    <
    form action="admin/action.php" method="post">
    Your e-mail
    <
    input type="text" name="email">
    <
    p>Type of message:<br>
    <
    input type="radio" name="type" value="comment"Comment
    <br>
    <
    input type="radio" name="type" value="question"Question
    <br>
    <
    input type="radio" name="type" value="complaint"Complaint<p>
    <
    textarea name="message" rows="10" cols="30">
    </
    textarea><br>
    <
    INPUT type="submit" value="Send"> <INPUT type="reset">

    </
    form
    Here is what I have for admin/action.php...
    PHP Code:
    <?php
    $type 
    $_POST["type"];
    $message $_POST["message"];
    $email $_POST["email"];
    mail("smrpgx@gmail.com""$type""$message $REMOTE_ADDR $email")
       
    ?>
    Can someone tell me what I am doing wrong? I'm new at this stuff so please don't point and laugh at me.

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,083
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Are you getting an error or what? Please provide a little more detail about the problem you're having.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    New Coder
    Join Date
    Feb 2006
    Location
    Germany
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure if that helps but $REMOTE_ADDR only works with register_globals on, since you however use $_POST I assume it is off

    To get the sender's IP address, use $_SERVER['REMOTE_ADDR']

    I doubt it'd do much but perhaps try:
    PHP Code:
    <?php
    $target 
    "smrpgx@gmail.com";
    $type $_POST["type"];
    $message $_POST["message"]."\n\n".$_SERVER['REMOTE_ADDR']."\n\n".$_POST["email"];
    mail($target$type$message"From: Scriptmailer <noreply@none.com>\nX-Mailer: PHP/" phpversion());)
    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •