I am using a php namespace on my html page. I'm using Windows 8. My code works perfict on my machine which is running WAMPSERVER 2.5. I uploaded the files to my web site and got a parse error that says:
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /home/content/15/8677915/html/myDirectory/fileName.html on line 73
Line 73 has this line of code: use myNamespace\UploadFile;
Here's the partial code that causes the error:
<?php
use myNamespace\UploadFile; <--------line 73
require_once 'uploads/src/myNamespace/UploadFile.php';
if (!isset($_SESSION['maxfiles'])) {
$_SESSION['maxfiles'] = ini_get('max_file_uploads');
$_SESSION['postmax'] = UploadFile::convertToBytes(ini_get('post_max_size'));
$_SESSION['displaymax'] = UploadFile::convertFromBytes($_SESSION['postmax']);
}
....more code....
?>
I tried using escape like this: use myNamespace\UploadFile; but still the same error. So I figured it may have something to do with UploadFile.php so I removed the line: use myNamespace\UploadFile; Then I got a another parse error. This time it came from the UploadFile.php. Here's what the error looks like:
Parse error: syntax error, unexpected T_STRING in /home/content/15/8677915/html/dc-esports/uploads/src/myDirectory/UploadFile.php on line 2
Here's the code that is at the very top of the UploadFile.php file:
<?php
namespace westcoastchill; <--------- line 2
class UploadFile
{
protected $destination;
protected $messages = array();
protected $maxSize= 51200;
.....more code here
?>
What is the parsing error here?