0
$sql = mysql_query("SELECT id, username, firstname,lastname, country, trade FROM myMembers WHERE email_activated='1' ORDER BY id ASC"); 
$sql2 = mysql_query("SELECT id, username, firstname,lastname, country, trade FROM mymembers WHERE email_activated='1' ORDER BY id DESC $limit"); 
$paginationDisplay = ""; 
if ($lastPage != "1"){
$paginationDisplay .= 'Page <strong>' . $pn . '</strong> of ' . $lastPage. '<img      src="images/clearImage.gif" width="48" height="1" alt="Spacer" />';
if ($pn != 1) {
$previous = $pn - 1;
$paginationDisplay .=  '&nbsp;  <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $previous . '"> Back</a> ';
} 
$paginationDisplay .= '<span class="paginationNumbers">' . $centerPages . '</span>';
if ($pn != $lastPage) {
$nextPage = $pn + 1;
$paginationDisplay .=  '&nbsp;  <a href="' . $_SERVER['PHP_SELF'] . '?pn=' .$nextPage    . '"> Next</a> ';} }
$outputList = '';
while($row = mysql_fetch_array($sql2)) { $id = $row["id"];
$username = $row["username"];
$firstname = $row["firstname"];
$lastname = $row["lastname"];
$country = $row["country"];
$trade=$row["trade"];
$check_pic = "members/$id/image01.jpg";
$default_pic = "members/0/image02.jpg";
if (file_exists($check_pic)) {
$user_pic = "<img src="$check_pic" width="150px"; height="150px";  />";     } else {
$user_pic = "<img src="$default_pic" width="150px" height="150px";  />"; // forces    default picture to be 120px wide and no more}
$name=$firstname.' '.$lastname; 
$outputList .= '<div id="content" class="clearfix"><section id="left"><div       id="userStats class="clearfix"><div class="pic">
<a href="profile.php?id=' . $id . '" target="_self">' . $user_pic . '</a></div><div   class="data">
<h1><a href="profile.php?id=' . $id . '" target="_self">' . $name. '</a></h1>
<h3>From: ' . $country .'<h3>
<h3>Trade: ' . $trade .'<h3>
<h3>Username: ' . $username .'</h3>
<div class="sep"></div>
<ul class="numbers clearfix">
<li><a href="profile.php?id=' . $id . '" target="_self">Full Profile</a></li>
<li><a href="info.php?id=' . $id . '" target="_self">About</a></li>
<li><a href="blab.php?id=' . $id . '" target="_self">WhiteBoard</a></li>
</ul></div></div></section></div><br>';}

此代码在 localhost 中有效,但在已部署的服务器中无效。

这是用户登录后被引导的页面。服务器上的错误是:Parse error: syntax error, unexpected T_VARIABLE in /home/u576778821/public_html/interact/index.php on line 119

119 线在哪里

    $user_pic = "<img src="$check_pic" width="150px"; height="150px";  />"; 

现在我正在使用免费的 azuka.biz 服务器。

4

3 回答 3

2

试试这个,

$user_pic = "<img src='".$check_pic."' width="150px" height="150px"  />";

或者

$user_pic = '<img src="'.$check_pic.'" width="150px" height="150px" >';
于 2012-09-28T07:03:35.357 回答
1

观看应该是的报价

$user_pic = "<img src=\"$check_pic\" width=\"150px\" height=\"150px\"  />";

或者

$user_pic = "<img src='".$check_pic."' width='150px' height='150px'  />";

编辑,

注意宽度和高度后的分号。他们不应该在那里

于 2012-09-28T07:04:04.087 回答
0

将您的第 119 行转换为:

$user_pic = "<img src='".$check_pic."' width='150px' height='150px' />"; 

$check_pic 前后的点 (.) 表示您执行字符串连接。

于 2012-09-28T07:03:50.093 回答