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

    Parse error: parse error, unexpected T_VARIABLE

    Contents info.php

    <form method="post" action="sendmail.php">

    <p><strong>Name: </strong>
    <input name="name" type="text"/>
    <br/><br />

    <strong>Phone Number: </strong>
    <input name="number" type="text" />
    <br/><br />

    <strong>E-mail:</strong>
    <input name="email" type="text" />
    <br/><br />

    <strong>Comments: </strong>
    <textarea name="message" cols="40" rows="10"></textarea>
    <br /><br />

    </p>
    <input type="submit" name="Send" value="Send"/>

    </form>

    Contents sendmail.php

    <?PHP

    $to = "my@email.com";

    $subject = "Info Request From Results From";

    $name = $_REQUEST['name'];

    $number = $_REQUEST['number'];

    $email = $_REQUEST['email'];

    $message = $_REQUEST['message'];



    mail($to, $subject, $name $number $email $message, "From: $email");



    header("Location: thankyou.php");

    ?>


    I get an <?PHP

    $to = "tyfeatherston@gmail.com";

    $subject = "Info Request From Results From";

    $name = $_REQUEST['name'];

    $number = $_REQUEST['number'];

    $email = $_REQUEST['email'];

    $message = $_REQUEST['message'];



    mail($to, $subject, $name $number $email $message, "From: $email");



    header("Location: thankyou.php");

    ?>

    Parse error: parse error, unexpected T_VARIABLE in /home/content/sendmail.php on line 28

    Please help!!!
    Last edited by tyfeatherston; 01-20-2008 at 06:06 AM.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by tyfeatherston View Post
    Parse error: parse error, unexpected T_VARIABLE in /home/content/sendmail.php on line 28
    Contents sendmail.php

    PHP Code:
    <?PHP
        $to 
    "my@email.com";
        
    $subject "Info Request From Results From";
        
    $name $_REQUEST['name'];
        
    $number $_REQUEST['number'];
        
    $email $_REQUEST['email'];
        
    $message $_REQUEST['message'];

        
    mail($to$subject$name  $number  $email  $message"From: $email"); // line 28
    - you miss "," after $name, $number, $email in mail(...) line


    best regards


  •  

    Posting Permissions

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