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
  1. #1
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question mailing "$var" in $var =

    I am having a ton of trouble trying to mail the data that was entered into a form using $variables inside another $variable's quotes. It will mail the typed text but will not display the variable in the mail message that it received. Here is the code, all the other codes are fine but this one php page....

    PHP Code:

    <?php
    $to 
    "pantheon8@maximized.org";
    $subject "Error Report";
    $email "error_report" ;
    $message "From: $message1
                Type of Issue: $message2
                Message: $message3 \n"
    ;
    $message1 $_REQUEST['email'];
    $message2 $_REQUEST['type'];
    $message3 $_REQUEST['message'];
    $headers "From: $message1";
    $sent mail($to$subject$message$headers) ;
    if(
    $sent)
    {print 
    "Your mail was sent successfully"; }
    else
    {print 
    "We encountered an error sending your mail"; }
    ?>
    Please Help

    -Pantheon8
    Last edited by Pantheon8; 08-10-2009 at 04:36 PM.

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Quite obvious, the variables do not exist yet. You are defining $message1, $message2, etc, after including them in the previous string.

  • Users who have thanked kbluhm for this post:

    Pantheon8 (08-10-2009)

  • #3
    New to the CF scene
    Join Date
    Aug 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile

    omg... I feel so dumb...

    atleast now i know! Its kinda like the order the <tr> and <td> have to be in a table...

    Thanks sooo much!


  •  

    Posting Permissions

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