php表单处理操作
最近自学了PHP,刚学会表单。简单说一下。
首先我在这里用了两个软件,一个是PHPstudy,一个是phpstorm。
安装也很简单,这里就不多说了。
步骤:1。打开phpstudy
就是这样:
2.打开编辑器,我用的是phpstudy,因为我的phpstudy保存在E盘。
因此,我直接在目录e : \ phpstudy \ phpTutorial \ www中创建了两个文件,一个是index.php,一个是welcome.html。
这是两个文件的代码
index.php
欢迎?php头(' Content-type : text/html;charset=utf-8 ');echo $ _ POST[' fname '];Br你多大了?PHP echo $ _ POST[' age '];岁。welcome.html
!doctype html html lang=' en ' head meta charset=' utf-8 ' title holder tutorial/title/head dyform action=' index . PHP ' method=' post ' name:input type=' text ' name=' fname ' age:input type=' text ' name=' age ' input type=' submit ' value=' submit '/form/body/html
这里,标题(' content-type : text/html;charset=utf-8 ');这一行代码就是为了解决中文乱码PHP的问题。
看一下效果图。
点击提交,
以上就是本文的全部内容。希望对大家的学习有帮助,支持我们。