在同一个页面下的代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="2.php">
<label for="name">name</label>
:
<input type="text" name="name" id="name" />
<!-- <input type="submit" name="button" id="button" value="提交" />-->
<input name="Button2" type="submit" class="btn_grey" id="Button2" onClick="window.location.href='2.php'" value="完成借阅"></td>
</form>
<?php
echo 'a:'.$_POST[name];
?>
</body>
</html>上面的代码中,最重要的是把按钮的type设置为submit,如果是button是接收不到数据的!
更多相关教程请访问 php编程从入门到精通全套视频教程
PbootCMS是一款高效、简洁、强悍的开源PHP企业网站开发建设管理系统。 PbootCMS 1.1.8 更新日志:2018-08-07 1.修复提交表单多选字段接收数据问题; 2.修复登录过程中二次登陆在页面不刷新时验证失败问题; 3.新增搜索结果fuzzy参数来控制是否模糊匹配; 4.新增父分类,顶级分类名称及链接独立标签,具体见手册; 5.新增内容多图拖动排序功能。
243
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号