parse error, unexpected T_VARIABLE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • redsky
    New Member
    • May 2008
    • 1

    parse error, unexpected T_VARIABLE

    Hi,

    I'm getting this error in my code (trying to make a submit button work) and can't figure out what the problem is. Can someone help me?

    Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\vhos ts\silverstudio hamilton.com\ht tpdocs\contact. php on line 3

    Here is the code:[php]<?php
    $your_name = $_GET['name'];
    $your_E-mail = $_GET['email'];
    $your_message_h ere = $_GET['message'];
    $recipient_emai l = “ info@redskydesi gn.com ”
    $subject = “from ” . $your_E-mail;
    $headers = “From: ” your_name .” <” . $your_Email . ”>\n”;
    $headers .= 'Content-type: text/html; charset=iso-8859-1';
    $content = "<html><head><t itle>Contact letter</title></head><body><br> ";
    $content .= "Name: <b>" . $your_name . "</b><br>";
    $content .= "E-mail: <b>" . $your_email . "</b><br><hr><br>" ;
    $content .= $your_message;
    $content .= "<br></body></html>";
    mail($recipient _email,$subject ,$content,$head ers);
    ?>
    <html>
    <body bgcolor="#282E2 C">
    <div align="center" style="margin-top:60px;color: #FFFFFF;font-size:11px;font-family:Tahoma;f ont-weight:bold">
    Your message was sent. Thank you.
    </div>
    </body>
    </html>
    <script>resizeT o(300, 300)</script>[/php]redsky
    Last edited by ronverdonk; May 2 '08, 09:31 AM. Reason: code tags
  • kardon33
    New Member
    • May 2007
    • 158

    #2
    On line 3 of your script you cannot declare a variable with '-' change that to a underscore and it should work.

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      And use code tags in your posts!

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        be sure to change all the oter $your_Emails because you swtich between lower and uppercase, hypen and no hypen.

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          WARNING:
          Please enclose your posted code in [code] tags (See How to Ask a Question).

          This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

          Please use [code] tags in future.

          MODERATOR

          Comment

          Working...