bform1.php
<!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=big5" />
<title>form1</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<input type="submit" name="Sure" value="確定" />
<input type="submit" name="clear" value="取消" />
<input type="submit" name="temp" value="暫不處理" />
<input type="button" name="Submit" value="提示" onclick="alert('提示:請記得填寫聯絡電話');" />
<input type="button" name="Submit" value="開啟" onclick="window.open('demo.html','','height=160,width=200');" />
<input type="button" name="Submit" value="前往虎科大" onclick="location.href='http://www.nfu.edu.tw';" />
</form>
<?php
if(count($_POST)) // 判斷是否有按按扭
{
echo "你按了";
if(isset($_POST['Sure'])) // 判斷是否按到確定按扭
{
echo $_POST['Sure'];
}
elseif(isset($_POST['clear'])) // 判斷是否按到取消按扭
{
echo $_POST['clear'];
}
else
{
echo $_POST['temp'];
}
}
/*
if(count($_POST))
{
echo "你按了";
echo $_POST['Sure'];
echo $_POST['clear'];
echo "<br/>共接收".count($_POST)."筆資料";
};
if(isset($_POST['Sure']) || isset($_POST['clear']))
{
echo "你按了";
echo $_POST['Sure'];
echo $_POST['clear'];
echo "<br/>共接收".isset($_POST)."筆資料";
};
*/
?>
<hr>
<form id="form2" name="form1" method="post" action="form1PP.php">
<input type="submit" name="Sure" value="同意" />
<input type="submit" name="clear" value="暫時不確定" />
<input type="submit" name="temp" value="不同意" />
<input type="button" name="Submit" value="版權" onclick="alert('作者:不名\n\n請勿做任何殊途');" />
<input type="button" name="Submit" value="提示" onclick="window.open('demo.html','','height=160,width=200');" />
<input type="button" name="Submit" value="前往Yahoo" onclick="location.href='http://www.nfu.edu.tw';" />
</form>
</body>
</html>
-
Dos指令
留言列表