Parse error: syntax error, unexpected T_VARIABLE in C:\AppServ\www\hello.php on line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sunnia
    New Member
    • Mar 2016
    • 1

    #1

    Parse error: syntax error, unexpected T_VARIABLE in C:\AppServ\www\hello.php on line

    Code:
    <html>
    <head>
      <title>hello world </title>
    </head>
    <body>
      <h1>
    <? pho
    $con=mysql_connect("localhost:3306","root","xyz123");   //line8
    if(!$con)
    {
    echo "failed"<br>;
    echo"false no:".mysqp_errno()."<br>";
    echo"false information:".mysqp_error()."<br>";
    die();
    }
    echo "success!<br>";
    ?>
    </h1>
    </body>
    </html>

    This is my code..unexpecte d T_VARIABLE in C:\wamp\www\hel lo.php on line 8
    Last edited by Rabbit; Mar 11 '16, 06:36 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    The cause of the error is on line 7.

    Code:
    <? pho
    should be
    Code:
    <?php

    Comment

    Working...