post表單提交資料,顯示找不到檔案,可是get方法可以獲取提交的資料,這是什么原因
//前臺代碼
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>利用$_GET和$_POST變數的輸出頁面</title>
<style type="text/css">
<!--
.STYLE1 {
color: #990000;
font-weight: bold;
font-size: 36px;
}
.STYLE2 {font-size: 12px}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="GET" action="get.php">
<p align="center" class="STYLE1">使用$_GET變數提交資料</p>
<p align="center">
<span class="STYLE2">用戶名:</span>
<label>
<input name="user" type="text" size="15" id="user" />
</label>
<span class="STYLE2">密碼:</span>
<label>
<input name="pass" type="password" size="15" id="pass" />
</label>
<label>
<input type="submit" name="Submit" value="https://bbs.csdn.net/topics/提交" />
</label>
</p>
</form>
<form id="form2" name="form2" method="POST" action="post.php">
<p align="center" class="STYLE1">使用$_POST變數提交資料</p>
<p align="center">
<span class="STYLE2">用戶名:</span>
<label>
<input name="user" type="text" size="15" id="user" />
</label>
<span class="STYLE2">密碼:</span>
<label>
<input name="pass" type="password" size="15" id="pass" />
</label>
<label>
<input type="submit" name="Submit2" value="https://bbs.csdn.net/topics/提交" />
</label>
</p>
</form>
</body>
</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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>利用$_GET變數的輸出頁面</title>
</head>
<body>
<?php
if(isset($_GET['Submit']) and $_GET['Submit']=="提交"){
echo "用戶名為:".$_GET['user']."<br>";
echo "密碼為:".$_GET['pass'];
}
?>
</body>
</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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>利用$_POST變數的輸出頁面</title>
</head>
<body>
<?php
if(isset($_POST['Submit2']) and $_POST['Submit2']=="提交") {
echo "用戶名為:" . $_POST['user'] . "<br>";
echo "密碼為:" . $_POST['pass'];
}
?>
</body>
</html>


轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/60993.html
標籤:非技術類
上一篇:labview
