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 7 of 7

Thread: script error

  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    147
    Thanks
    31
    Thanked 2 Times in 2 Posts

    script error

    Hi this script used to work
    but it does not work.. can you please help me correct it...

    thanks

    Andrew

    <?
    //echo "Title[$Title]";
    $txtTo = "info@thet.co.za,te@t.co.za,om@hot.com";
    $txtFrom = "info@test.co.za";
    $subject = "test";
    $header = " \n\n";
    $footer = " \n";


    // continue with rest of form...
    $message .= "Name : $name \n\n";
    $message .= "E-mail : $email \n\n";
    $message .= "Telephone : $code $tel \n\n";
    $message .= "Question : $textarea \n\n";



    mail ($txtTo, $subject, $header . $message . $footer, $txtFrom);

    ?>

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    What doesn't work on it? Doesn't send? Sends blank email? Get an error?

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    147
    Thanks
    31
    Thanked 2 Times in 2 Posts
    hi

    I get this error:


    Notice: Undefined variable: message in /home/test.com/ftp/html/sent.php on line 11


    thanks for the help

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Change this
    PHP Code:
     $message .= "Name : $name \n\n";
    $message .= "E-mail : $email \n\n";
    $message .= "Telephone : $code $tel \n\n";
    $message .= "Question : $textarea \n\n"
    to
    PHP Code:
    $message "Name : $name \n\n";
    $message .= "E-mail : $email \n\n";
    $message .= "Telephone : $code $tel \n\n";
    $message .= "Question : $textarea \n\n"

  • #5
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Nightfire, sorry to sound like a complete idiot here, but why is a dot being used after the variable name? like $message .=?

    Last edited by JamieR; 06-30-2005 at 02:52 PM.

  • #6
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    The '.' is the concatenation operator, it's just like '+=' in other languages. So it takes whats allready in the variable and tacs more onto the end.

  • #7
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    ah right, thanks - I gotta learn more php


  •  

    Posting Permissions

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