Link to home
Start Free TrialLog in
Avatar of SimonHowald
SimonHowald

asked on

PHP Parse error: parse error, unexpected T_STRING in

PHP Parse error:  parse error, unexpected T_STRING in abc.php  on line 2:
I'm getting this on Linux environment but the same script works on Windows box.

Anything wrong?

the contents of the abc.php is as follows:




<?php header('Content-type: text/xml'); ?>
<?xml version="1.0" encoding="utf-8" ?>
<categories>
<?php
 
include 'config.php';
$con = mysql_connect($dbhost, $dbuser, $dbpass);
if (!$con)
{
  die('Could not connect: ' . mysql_error());
}
 
..
..
..
 
?>
</categories>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of aldanch
aldanch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SimonHowald
SimonHowald

ASKER

Thanks it worked. One more question before I close this chain...
why do we need to do this?
you are PHP Genius!
The XML headers use "<?" and "?>" ...just like PHP ;)

PHP didn't know how to handle "xml version..." so you had to echo it.

Hope that helps!
thanks!