PHP Curl Redirection problem

Source: Internet
Author: User
Just contact Curl want to use curl post information and redirect to Destination page (with Send post message redirect)
 
  "Bar",    "Query" = "Nettuts",    "action" = "Submit"); $ch = Curl_init (); curl_setopt ($ch, Curlopt_url, $url) ; curl_setopt ($ch, Curlopt_post, True); curl_setopt ($ch, Curlopt_returntransfer, True); curl_setopt ($ch, Curlopt_ Followlocation, True); curl_setopt ($ch, Curlopt_cookiefile, ' cookie.txt '); curl_setopt ($ch, Curlopt_postfields, $post _data); curl_setopt ($ch, curlopt_maxredirs,10); curl_setopt ($ch, curlopt_useragent, $_server[' Http_user_agent '); $ Output = Curl_exec ($ch); Curl_close ($ch);


According to the things on the Internet set a lot and do not know if there is no use, just want to make the address of the last address bar into test_output.php, but always unsuccessful.
Isn't curl simply not going to jump? Or I set the question, ask you big answer, thank you!


Reply to discussion (solution)

Curl does not change the address bar address.

Just contact Curl want to use curl post information and redirect to Destination page (with Send post message redirect)
PHP code?123456789101112131415161718 "Bar",......

What does curlopt_followlocation mean by this attribute? Solving... Finish to the points.

Curl does not change the address bar address.

。。。 The previous sticker was wrong ...

What does curlopt_followlocation mean by this attribute? Solving... Finish to the points.

The meaning of Curlopt_followlocation is:
When the target page jumps, that is, the HTTP header has a location command, then read the new target page
If this property is not set, curl will read only one page

The meaning of Curlopt_followlocation is:
When the target page jumps, that is, the HTTP header has a location command, then read the new target page
If this property is not set, curl will read only one page

Thank you!

  • 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.