unexpected T

As I try to load a website the following error shows up:

unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

It says that the error is on line 5.

<?php

 ob_start();
 header("Location: /localhost/site1");
 echo '<meta http-equiv="refresh" content="0;URL='/localhost/site1'">'; //line 5
 die();

?>

Update:

At this point my code looks like:

<?php

 ob_start();
 header("Location: /localhost/site1");
 echo '<meta http-equiv="refresh" content="0;URL='/localhost/site1'">';
 die();

?>

But still the same error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /localhost/site1/index.php on line 5

I also tried to use:

echo '<meta http-equiv="refresh" content="0;URL=/localhost/site1">';

But same problem.


Check the quotationmarks...

 echo '<meta http-equiv="refresh" content="0;URL=/localhost/site1">'; //line 5

The syntax highlighting of SO shows it:

echo '<meta http-equiv="refresh" content="0;URL='/localhost/site1'">'; //line 5
     ^-----                                     ^----------------^  ^- --

你忘了逃避'在网址中

 ob_start();
 header("Location: /localhost/site1");
 echo '<meta http-equiv="refresh" content="0;URL='/localhost/site1'">'; //line 5
 die();

?>

尝试这个

echo '<meta http-equiv="refresh" content="0;URL='/localhost/site1'">';
链接地址: http://www.djcxy.com/p/69648.html

上一篇: 致命错误语法错误,意外的T

下一篇: 意外的T