下面的代碼不工作,因爲該頁面什麼都不顯示,我不確定爲什麼。它從URL中獲取一些東西,然後從數據庫中獲取最終的Album名稱。以下是代碼:帶MySQL的PHP頁面沒有顯示/正在工作
<?php
$cart1 = rawurldecode($_GET["path"]);
list(, , , , , $cart2) = explode ("\\", $cart1);
$cart3 = $cart2;
list($cart4) = explode (" ", $cart3);
$con = mysql_connect("SERVER","USER","PASS");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("cartmatch", $con);
$result = mysql_query("SELECT * FROM cartmatch WHERE CARTNO='$cart4'");
while($row = mysql_fetch_array($result))
{
echo '<form enctype="multipart/form-data" action="albumgo.php" method="POST"><input name="ID" type="hidden" value=';
echo $_GET["ID"];
echo ' ><input name="enabled" type="hidden" value=';
echo $_GET["enabled"];
echo ' ><input name="artist" type="hidden" value=';
echo $_GET["artist"];
echo ' ><input name="title" type="hidden" value="';
echo $_GET["title"];
echo '" >Name:<br/><input name="album" type="text" autofocus="autofocus" value="';
echo $row['ALBUM'];
echo '" ><input type="submit" name="edit" value="Save"></form>';
}
mysql_close($con);
?>
附加使用error_reporting(1);就在我剛剛做的<?php – 2012-07-13 21:40:08
下,但沒有。 – austinhollis 2012-07-13 21:40:55
@ user790068添加'error_reporting(E_ALL); ini_set('display_errors',1);回聲「測試輸出」;'在頂部而不是 – DaveRandom 2012-07-13 21:41:35