表单处理练习

By admin, 1 十二月, 2016

这个练习的目的是理解前端和后端的交互。前端,我们实现如下表单:

学号: 姓名: 年级: 班别:

 

实现的步骤大致如下:

  1. 新建一个文件form.html,用HTML实现前端表单,参考:http://www.w3school.com.cn/html/html_forms.asp,其中下拉表单的实现参考:http://www.w3school.com.cn/html/html_form_elements.asp
  2. 新建一个文件handle_form.php,在后端用PHP处理表单提交数据。参考:http://www.w3school.com.cn/php/php_forms.asp
  3. 在handle_form.php中接收到数据之后,把数据插入到数据库。之前的练习我们是用PhpMyAdmin手工插入的,而这次是用PHP程序插入的。参考:http://www.w3school.com.cn/php/php_mysql_insert.asp

评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"Drupal10"