PHP按鈕返回404異常

來源:互聯網
上載者:User
PHP按鈕返回404錯誤
書上的內容,然後已經建立了資料庫和login.php檔案。
    require_once 'login.php';
$db_server = mysql_connect($db_hostname,$db_username,$db_password);

if(!$db_server)die("Unable to connect to MySQL:".mysql_error());

mysql_select_db($db_database)
or die("Unable to select to MySQL:".mysql_error());

if(isset($_post['delete']) && isset($_POST['isbn']))
{
$isbn = get_post('isbn');
$query = "DELETE FROM classics WHERE isbn='$isbn'";

if(!mysql_query($query, $db_server))
echo "DELETE failed: $query
".mysql_error()."

";
}

if(isset($_post['author']) &&
isset($_post['title']) &&
isset($_post['category']) &&
isset($_post['year']) &&
isset($_post['isbn']))
{
$author = get_post('author');
$title = get_post('title');
$category = get_post('category');
$year = get_post('year');
$isbn = get_post('isbn');

$query = "INSERT INTO classics VALUES".
"('$author','$title','$category','$year','$isbn')";

if(!mysql_query($query, $db_server))
{
echo "INSERT failed: $query
".mysql_error()."

";
}
}

echo <<<_END



_END;

$query = "SELECT * FROM classics";
$result = mysql_query($query);

if(!$result) die("Datebase access failed: ".mysql_error);

$rows = mysql_num_rows($result);

for($j = 0; $j<$rows; ++$j)
{
$row = mysql_fetch_row($result);
echo <<<_END

Author $row[0]
Title $row[1]
category $row[2]
year $row[3]
ISBN $row[4]



_END;
}

mysql_close($db_server);

function get_post($var)
{
return mysql_real_escape_string($_POST[$var]);
}

?>

該網頁顯示正常,但是一按ADD RECODE按鈕就會出現Object Not Found錯誤,並且底下有Error 404。
求大神幫忙呢。。。
------解決思路----------------------
加斷點一步一步調試。
------解決思路----------------------

sqltext.php 這個檔案有嗎?


------解決思路----------------------
sqltext.php 存在嗎?
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.