Pass the value obtained by post and get on the same page to the form.

Source: Internet
Author: User
Pass the values obtained from post and get on the same page into the form PHPcode $ rkno $ _ GET [rkno]; $ type $ _ GET [type]; $ kw_info $ _ POST [kw_info]; these are the values obtained from the previous page. The values of $ rkno and $ type are obtained from the previous page of the previous page. Put these values into a form: PHPcode & lt; f, and pass the values obtained from post and get on the same page into the form.
PHP code
  $rkno = $_GET['rkno'];$type = $_GET['type'];$kw_info = $_POST['kw_info'];


These are the values obtained from the previous page. The values of $ rkno and $ type are obtained from the previous page of the previous page. Then put these values into a form:
PHP code
  
  


$ _ POST is passed in, but the $ kw_info value in form is not obtained. why?




------ Solution --------------------
We recommend that you use $ _ REQUEST to obtain the values of $ _ GET and $ _ POST at the same time ..
------ Solution --------------------
You give, form codeWhat is output in the end? The result is clear.
------ Solution --------------------
Discussion

Reference:

What are you talking about?

If there are three pages a, B, and c, $ _ GET ['rkno'] and $ _ GET ['type'] are uploaded from page a to page B through get, then, post a $ _ POST ['kw _ info'] from page B and connect it to the previous $ _ GET ['rkno']. the value of $ _ GET ['type'] is uploaded to the c page. In this case, values of $ _ GET and $ _ POST can be obtained. I want to add the three values to a form on the c page ......

------ Solution --------------------
Does the $ kw_info obtained on page c have no value? Output:
Echo $ kw_info = $ _ POST ['kw _ info'];
------ Solution --------------------
He should input a value on page a and submit it to page B, while Page B's If no value is selected, go to the c page and use post to retrieve the value. on page B, we recommend that you get $ kw_info to the url, change $ kw_info = $ _ POST ['kw _ info']; to $ kw_info = $ _ REQUEST ['kw _ info'];

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.