运行php代码时出问题

时间:2016-01-30 22:04:39

标签: php error-handling

当我安装此脚本时出现此错误error 这行congig.php文件line

你能帮我解决错误

吗?
    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', '1');

    $host       =   "localhost"; // your mysql server address
    $user       =   "root"; // your mysql username
    $pass       =   ""; // your mysql password
    $tablename  =   "ses"; // your mysql table

    session_start();
    $data = null;
    if(!(@mysql_connect("$host","$user","$pass") && @mysql_select_db("$tablename"))) {
        ?>
        <html>
        MSQL ERROR
        <?
        exit;
    }

    include_once 'functions.php';
    require_once "includes/pluggable.php";
    foreach( glob("plugins/*/index.php")  as $plugin) {  
      require_once($plugin);  
    }  

    hook_action('initialize');

    $site = mysql_fetch_object(mysql_query("SELECT * FROM settings"));
    ?>

1 个答案:

答案 0 :(得分:0)

你得到了这个:

     ?>
    <html>
    MSQL ERROR
    <?
    exit;

你需要这个:

     ?>
    <html>
    MSQL ERROR
    <?php
    exit;
除非您在php.ini中启用了short_open_tag,否则

<?不是有效的开始标记