php学习笔记(一)之接收参数

最近看了一下

http://www.enet.com.cn/eschool/video/php/ 

PHP编程的基础入门课程

也试着做了一下

环境搭建视频上蛮详细的,不过在用php连接Mysql的配置的时候要注意,这点很不容易一次配置正确.照着视频上面的也不能成功!

 

现在就来说下接收参数

 

新建一个index.html

<form name="form1" method="post" action="Message_Receive.php"> <input name="strContent" type="text" value=""/> <input type="submit" name="Submit" value="提交"/> 页面传递 </form>

再新建一个Message_Receive.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=gb2312" /> <title>无标题文档</title> </head> <body> <?php //接收参数 strContent $strContent=$HTTP_POST_VARS["strContent"]; echo "<li/>成功接收参数:strContent=".$strContent; ?> </body> </html>

然后在index.html中输入信息点击提交.会跳转到Message_Receive.php.

 

 

你可能感兴趣的:(html,PHP,mysql,XHTML,input,action)