The first PHP program after the PHP environment is set up.
Author: Qing Dujun
Address: http://blog.csdn.net/qingdujun/article/details/41577327
I wrote this article to myself. This problem has been entangled for a long time. I am a super beginner in php;
I copied an xampp file from my classmates and installed it to develop PHP. My default localhost directory is:C: \ xampp \ htdocs
Note the following when submitting a php form:
You cannot directly click HTML to open the page. Without the http: // localhost prefix, you cannot submit the HTML document to the PHP document correctly.
Here, you must put all HTML and PHP under your localhost directory (which can be under the subdirectory ).
For example, I created a php folder in the default directory ~~~
Then, I have 2 files in this folder, 1.html and 1.php.
Note: When accessing html, enter the following xxxxxxx in the address bar. (You cannot directly click 1.html to open the webpage ).
Hey hey, click submit and then interact with php ..........
I have compiled a small program for php processing to submit data on a webpage;
1. HTML code
<! Doctype html> 2. php code
Hello everyone, I am <? Php echo $ _ POST ['user _ name'];?>! <? Php echo "<br/>"?> I am from <? Php echo $ _ POST ['hometown '];?>.
Address: http://blog.csdn.net/qingdujun/article/details/41577327
References: edited by Chen Hao, no-Basic PHP Learning (version 3rd)