PHPPOST: unable to read the downstream string

Source: Internet
Author: User
PHPPOST Upload, unable to read the uploaded string local c # write & nbsp; with WebClient class http://1.liuruitao.sinaapp.com/test.php? Name = {0} is uploaded through this url. & nbsp; if ($ _ SERVER ['request _ method'] = "POST") & nbs php post Upload, unable to read the uploaded string
Local c # write with WebClient class http://1.liuruitao.sinaapp.com/test.php? Name = {0} is uploaded through this url.

If ($ _ SERVER ['request _ method'] = "POST ")
{
// $ S = json_encode ($ _ post)

$ S = $ _ GET ["name"];
Echo "hello world !! ";
Echo $ _ POST ["name"];
$ Conn = mysql_connect (SAE_MYSQL_HOST_M. ':'. SAE_MYSQL_PORT, SAE_MYSQL_USER, SAE_MYSQL_PASS );
If (! $ Conn)
Die ("connect fail". mysql_error ());
Mysql_select_db ('app _ liuruitao', $ conn );
$ SQL = "insert into $ db values ('20140901', $ s, 3, '4', 5, '6', '7', '8 ', '9 ')";
Mysql_query ($ SQL, $ conn); // use an SQL statement to insert data.
Mysql_close (); // Close the MySQL connection
Echo "insert success ";
}
The strings in the uploaded name cannot be correctly obtained and inserted into the database. thank you for your help.

------ Solution --------------------
$ SQL = "insert into $ db values ('20140901', $ s, 3, '4', 5, '6', '7', '8 ', '9 ')";
If $ s has no value, the actual executed SQL command is
Insert into table name values ('20170101', 3, '4', 5, '6', '7', '8', '9 ')
It is obviously wrong.
Available
Mysql_query ($ SQL, $ conn) or die (mysql_error ());
Know if this situation exists
In addition
$ SQL = "insert into $ db values ('20140901', $ s, 3, '4', 5, '6', '7', '8 ', '9 ')";
Ying writing
$ SQL = "insert into $ db values ('20140901', '$ S', 3, '4', 5, '6', '7', '8 ', '9 ')";
Avoid unexpected events

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.