上我有一個PHP的簡單的HTML頁面,如下所示:差異網頁本地主機和主機服務器
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Articles 'n' More::Articles</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Articles, Management , english, computers, sharepoint, wp7, bio technology, nano technology, c#">
<meta name="keywords" content="Articles, Management , english, computers, sharepoint, wp7, bio technology, nano technology, c#">
<link rel="stylesheet" type="text/css" href="CSS/Style.css" />
</head>
<body>
<table border="1" width="100%">
<tr id="header" >
<td height="30%" width="100%" colspan="3">
<?php include("Header.php"); ?>
</td>
</tr>
<tr id="body">
<td width="15%" valign="top" align="left">
<table width="100%" border="3" align="left">
<tr ><td>
<?php include("LeftPanel.php"); ?>
</td>
</tr>
</table>
</td>
<td width="75%" valign="top">
<!--Articles-->
<?php
$articlePerPage="10";
$subcatID = $_GET['subcatid'];
$curPageId = $_GET['pageId'];
$nextPageId=$curPageId+1;
$prevPageId=$curPageId-1;
$con=mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("articles_db",$con);
$query="";
$queryCount="";
if($subcatID == "0")
{
$queryCount="select count(1) total from tbl_articles";
//echo "QueryCount is".$queryCount;
}
else
{
$queryCount="select count(1) total from tbl_articles where SUBCATEGORY_ID=".$subcatID;
}
$resultCount= mysql_query($queryCount);
$rowCount = mysql_fetch_array($resultCount);
$totlaArticles= $rowCount['total'] ;
//echo 'total articles'.$totlaArticles;
if($subcatID == "0")
{
$query="select * from (SELECT ARTICLE_ID,TITLE,CONTENT,POSTED_ON,POSTED_BY FROM TBL_Articles order by POSTED_ON desc limit ".$articlePerPage*$curPageId.") sub order by POSTED_ON asc limit ".$articlePerPage;
//echo $query;
}
else
{
$query="select * from (SELECT ARTICLE_ID,TITLE,CONTENT,POSTED_ON,POSTED_BY FROM TBL_Articles where SUBCATEGORY_ID=".$subcatID." order by POSTED_ON desc limit ".$articlePerPage*$curPageId.") sub order by POSTED_ON asc limit ".$articlePerPage;
}
$result = mysql_query($query);
?>
<table width="100%">
<tr id="repeatingRow" valign="top">
<td width="100%">
<?php
$count=0;
while($row = mysql_fetch_array($result))
{
$id= $row['ARTICLE_ID'] ;
$title= $row['TITLE'] ;
$content= $row['CONTENT'] ;
$count=$count+1;
if(strlen($content)< 110)
{
$content=substr($content,0,strlen($content));
}
else
{
$content=substr($content,0,100);
}
$postedon=$row['POSTED_ON'] ;
$author = $row['POSTED_BY'] ;
?>
<table width="100%">
<tr>
<th width="100%" colspan="3">
<a href="ShowArticle.php?articleid= <?php echo $id ; ?>&title=<?php echo $title ; ?>"><?php echo $title ; ?></a></th>
</tr>
<tr >
<h6>
<td width="30%" align="left"><img src="Images/account.png" /><?php echo $author ; ?></td>
<td width="30%" align="left"><img src="Images/clock.png" /><?php echo $postedon ; ?></td>
<td width="40%" align="left"><img src="Images/folder.png" />General</td>
</h6>
</tr>
<tr>
<td width="100%" colspan="3"><br/><?php echo $content ;?><br />
<hr color="#49a6e1">
</td>
</tr>
</table>
<?php
}
?>
</td>
</tr>
<tr>
<td align="center">
<b>
<?php
//echo $subcatID;
//echo ("<a href='Articles.php?subcatid=".$subcatID."&pageId=".$prevPageId."'>Previous</a>");
if($curPageId>1)
{
echo ("<a href='Articles.php?subcatid=".$subcatID."&pageId=".$prevPageId."'>Previous</a>");
//echo ("<a href='Articles.php'>Previous</a>");
}
?>
</b>
</td>
<td>
<b>
<?php
if($totlaArticles/($curPageId*10)>1)
{
echo ("<a href='Articles.php?subcatid=".$subcatID."&pageId=".$nextPageId."'>Next</a>");
//echo "<a href='Articles.php?subcatid='".echo $subcatID."@pageId= ".$nextPageId.">Next</a>"
}
?>
</b>
</td>
</tr>
</table>
</td>
<td height="65%" width="10%" valign="center">
<!--Right panel-->
</td>
</tr>
<tr id="footer" bgcolor="dfdfdf">
<td height="5%" colspan="3">
count is : <?php echo $count; include("Footer.php"); ?>
<!-- do not get this part when upload on server -->
</td>
</tr>
</table>
</body>
</html>
本頁面給出了當我嘗試它我的本地機器上所期望的結果。 但是,當我把它上傳到我的主機服務器,我面臨着以下問題:
- 這表明只有前3(在網頁上沒有滾動條)的文章中相應部分,在那裏爲我的本地機器上顯示所有的文章用滾動條。
- 不包括footer.php
- 不顯示背景色
- 設置我試圖設置邊框的表,但它不會顯示任何邊界上
我的本地機器我有XAMPP(Basispaket)版本1.7.4與PHP 5.3.5和服務器我有版本5.2.6(作爲CGI應用程序運行)
是否有任何人有我關於爲什麼我面臨這個問題,以及可能的解決方案是什麼。
很多事情都可能導致這種情況。你有沒有檢查你的服務器的PHP錯誤日誌? –