How to use $_post function in php to receive data from form in html

WBOY
Release: 2016-08-23 09:17:48
Original
1314 people have browsed it

I just started learning PHP. I searched a lot online but I can’t use the $_post function to print out the form data
This is the code
HTML part

  php test   
fs
PHP部分 按提交按钮后只能打印出php的代码
Copy after login
Copy after login

Reply content:

I just started learning PHP. I searched a lot online but I can’t use the $_post function to print out the form data
This is the code
HTML part

  php test   
fs
PHP部分 按提交按钮后只能打印出php的代码
Copy after login
Copy after login

  • Make sure the formactionpath is correct

  • php’sPOSTreceives a writing error. It needs to be capitalized$_POST['fs']. Your lowercase method will be parsed into a variable

$_POST

Capital letters.

PHP variables are case-sensitive. Methods, function names and constants are not distinguished (but they are still required to be consistent). They need to be capitalized as the friend above said, use $_POST[], and you said you can print out php Code, I think it shouldn’t be possible.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!