After the action attribute in form? The passed parameter cannot be obtained. formaction

Source: Internet
Author: User

After the action attribute in form? The passed parameter cannot be obtained. formaction

1 $ p_id = $ _ REQUEST ['P _ id']; 2 3 echo "

 

The above code uploads the $ p_id obtained on this page to the next page when you click button to submit to jump to updateproduct. do. php. However, each time you click a button, only" Updateproduct. do. php? P_name = 11 & p_price = 22 & p_pic = 33 & p_date = 44 & p_detail = 55"

P_id cannot be passed. After a long time, the reason is actually very simple. (The following is my understanding, but the problem is solved.) In method = get, form only receives the "name" attribute and corresponding "value" of the form element. Do you want to write by yourself in the action? To pass the value, the value of method must be = post, that is, the second line in the Code is changed:

<form action='updateproduct.do.php?p_id=$p_id' method='post'>

Change it to this!

 

Many of the above statements are not standardized and may not be rigorous. please correct me!

 

END

 

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.