PHP Curl login with redirect not working

后端 未结 3 1428
無奈伤痛
無奈伤痛 2020-12-22 04:48

I have the following PHP script which should get the content of a page, that is behind a login-form.

It is working fine on my localhost server, but it doesn\'t work

3条回答
  •  长情又很酷
    2020-12-22 05:49

    Try adding the FOLLOWLOCATION option so it follows the redirect it's getting:

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    

提交回复
热议问题