dsc7188 2014-02-04 19:22
浏览 55
已采纳

PHP转义字符串错误[关闭]

Little problem giving me lots of errors: I can't get the escapes right…

Parse error: syntax error, unexpected T_NS_SEPARATOR in /home/indyprogramming/public_html/Board.php on line 34

include "layout.top.php";   
$id = $_GET['id'];
$result[0] = mysql_query("SELECT * FROM `indy_thread` WHERE `id`='" . $id . "' LIMIT 1");
$row[0] = mysql_fetch_array($result[0]);    
print "<div align=\"left\">
";     $que = mysql_query("SELECT * FROM `indy_forums` WHERE `hash` = '" . $row[0]['connector'] . "'");    $wor = mysql_fetch_array($que); print "<div><a href=\"index.php\">Index</a> -> <a href=\"Forum.php?id=".$wor['id']."\">".$wor['name']."</a> -> " . $row[0]['name'] . "</div>
 <br />
";       print "<div class=\"c_1\">
";
print "
";
print $row[0]['name'] . "\t <br />
";
print "
";
print "</div>
";
print "<div style=\"height:5px;\">&nbsp;</div>
";
$result[1] = mysql_query("SELECT * FROM `indy_posts` WHERE `connector`='" . $row[0]['hash'] . "' ORDER BY `id` ASC");
$i = 0;
while( $row[1] = mysql_fetch_array( $result[1] ) )
{

    print "<div ";
    if( $i != ( mysql_num_rows( $result[1] ) - 1 ) )        {
        print "style=\"border-bottom:0px;\" ";
    }
    print "class=\"t_1\">
";

    if( ($_COOKIE['id']) AND ($user['class'] != "Member") )
    {


    print "<div style=\"position:relative;top:0px;left:25px;\"><a href=\"#\" onClick=\"loadDiv('post_" . ($i+1) . "', '/edit.message.php?id=".$row[1]['id']."')\">Edit this Message</a> || <a href=\"/d.msg.php?id=".$row[1]['id']."\">Delete this Message</a></div>
";


    }

    print "<div style=\"position:relative;top:10px;left:25px;\"><b>".replace(getUserData($row[1]['poster'],'name'))."</b></div>
";     
    print "<div style=\"position:relative;top:10px;left:25px;\">" . $row[1]['date'] . "</div>
";
    print "<div id=\"post_".$i+1.\" style=\"position:relative;top:50px;left:25px;max-width:750px;height:150px;overflow-y:scroll;border-right:1px solid #111;\">";

    $filename = $_SERVER['DOCUMENT_ROOT'] . "/fposts/" . $row[1]['message'] . ".txt";
    $file = fopen( $filename, "r+" );
    $display = fread( $file, filesize( $filename ) );
    fclose( $file );
    print replace( $display );

    print "</div>
";



    print "</div>
"; 
    $i = $i + 1;

}

if($user_logged)
{
    print "<br /><br />
";
    print "<div align=\"center\">
";
    print "<div><h2><b>Quick Reply @".$user['name']."</b></h2></div>
";
    print "<form action=\"/post.board.php?id=".$row[0]['id']."\" method=\"post\">
";
    include "msg.box.php";
    print "<br />
 <input type=\"submit\" value=\"Go!\" />
";
    print "</form>
";
    print "</div>
";
}
print "</div>
";
include "layout.bottom.php";
  • 写回答

1条回答 默认 最新

  • douguadao3883 2014-02-04 19:28
    关注

    This line had the quotes wrong. This should work-

    print "<div id=\"post_". $i+1 ."\" style=\"position:relative;top:50px;left:25px;max-width:750px;height:150px;overflow-y:scroll;border-right:1px solid #111;\">";
    //                           ^Added a extra " to complete the id quotes.
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据