Ask a basic question: how does name = "attachment. fileName" return a value? -Php Tutorial

Source: Internet
Author: User
Ask a basic question: how does name "attachment. fileName" return a value? The front-end defines the following set of input boxes to pass the uploaded file information.





The post method is submitted to the background. how can I set the value in the background?

Try $ _ REQUEST ['attachment. id']; the value cannot be obtained
Try $ _ REQUEST ['attachment'] ["id"]; the value cannot be obtained.

I don't know how to get it. Please advise first?


Reply to discussion (solution)

Print the $ _ REQUEST array ,,

After submission, "." is replaced "_"

$ _ REQUEST ['attachment _ id'];
And the value of your attachment_id does not have a value.

Print $ _ REQUEST.

Print_r ($ _ REQUEST );





You can write it in this way, and the background will be OK.
$ _ REQUEST ['attachment'] ["id"]; the value is

Var_dump ($ _ REQUEST );

$ _ REQUEST ['attachment _ id'];
Get the value. thank you for posting the Post upstairs.

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.