|
对php中获取表单单选框radiobutton数据的方法感兴趣的小伙伴,下面一起跟随脚本之家 jb51.cc的小编两巴掌来看看吧! html表单代码
/**
* php中获取表单单选框radiobutton数据的方法
*
* @param
* @arrange 512-笔记网: www.512Pic.com
**/
<html>
<body>
<form action="mychoice.php" method="post">
<b>Enter Name:</b>
<input type="text" size="45" name="username"> <br>
<b>Please select your favorite animal:</b> <br>
<input type="radio" name="animal" value="dog">Dog
<input type="radio" name="animal" value="cat">Cat
<input type="radio" name="animal" value="fish">Fish <br>
<input type="submit" value="Submit">
</form>
</body>
</html>
/*** 来自脚本之家 jb51.cc(jb51.cc) ***/ 后台php文件: mychoice.php
/**
* php中获取表单单选框radiobutton数据的方法
*
* @param
* @arrange 512-笔记网: www.512Pic.com
**/
<html>
<head>
<title>Form submission</title>
</head>
<body>
<br>
<?php
$username = $_POST['username'];
$animal = $_POST['animal'];
if(($animal != null))
{
$msg = "The animal you chose is $animal <br>";
echo($msg);
}
?>
</body>
</html>
/*** 来自脚本之家 jb51.cc(jb51.cc) ***/ (编辑:安卓应用网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|