使用Curl

编程入门 行业动态 更新时间:2024-10-28 16:20:36
本文介绍了使用Curl -PHP登录到远程URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在此登入 studio.smartshoot/filmmaker/home使用 CURL ,但似乎无法使其工作。结果是您的浏览器未启用JavaScript。在继续使用此网站之前,请在浏览器设置中启用 JavaScript c>。

I am trying to login here studio.smartshoot/filmmaker/home using CURL, but can't seem to get it to work.The result is it says "JavaScript is not enabled in your browser. Please enable JavaScript in your browser settings before continuing to use this site."

尝试了以下操作:

<? $username="username"; $password="password"; $url="ABC.COM?q=login&destination=filmmaker%2Fhome"; $cookie="cookie.txt"; $postdata = "name=".$username."&pass=".$password."&edit-user-login=user_login&edit-name=".$username."&remember_me=1"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); curl_setopt ($ch, CURLOPT_TIMEOUT, 60); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt ($ch, CURLOPT_REFERER, $url); curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt ($ch, CURLOPT_POST, 1); $result = curl_exec ($ch); echo $result; curl_close($ch); ?>

推荐答案

cURL不执行JavaScript,因此即使您已登录,您将获得作者用于noscript用户代理的任何消息。

the answer's in the question. cURL does not execute JavaScript, so even if you're logged in you'll get whatever message the authors intended for a noscript user-agent.

更多推荐

使用Curl

本文发布于:2023-06-04 22:11:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/506101.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Curl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!