您好我正在使用以下代码来显示表格,但它显示了这样的错误。
Warning: require(HTML/Table.php) [function.require]: failed to open stream: No such file or directory in /home/aspire/public_html/table.php on line 3
Fatal error: require() [function.require]: Failed opening required 'HTML/Table.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/aspire/public_html/table.php on line 3
这是我的代码。谁能告诉我我犯了什么错误。
require("HTML/Table.php");
$tableStyle = array("bgcolor"=>"#FFFFFF", "border"=>"1", "width"=>"150", "cellpadding"=>"1", "cellspacing"=>"2");
$colA = array("field 1", "field 2", "field 3", "", "<b>TOTAL</b>");
$a = 10;
$b = 15;
$c = 8;
$total = $a+$b+$c;
$colB = array($a, $b, $c, "", "<b>".$total."</b>");
$table = new HTML_Table($tableStyle);
$table->addCol($colA);
$table->addCol($colB);
$table->display();
使用这个“ php go-pear.phar ”命令我找到了以下路径。
Current include path : .:/usr/share/php:/usr/share/pear
Configured directory : /home/aspire/pear/share/pear
Currently used php.ini (guess) : /etc/php5/cli/php.ini
因此,在开始我的代码之前指定路径时
include_path=".:/usr/share/php:/usr/share/pear/";
它显示了类似的错误
Parse error: syntax error, unexpected '=' in /home/aspire/public_html/table.php on line 2
如何解决这个问题呢。