curl

Joomla 2.5 login with curl

醉酒当歌 提交于 2021-01-28 05:03:36
问题 I'm trying remotely access joomla 2.5 with curl in php. Later I want to create new content too, but for now i have troubles with login. For me is curl new so I don't know what am I doing wrong. I get this message: "Your session has expired. Please log in again.". Here is my code so far: $url = "http://localhost/joomla25/administrator/"; $cookie = "tmp/cookie".time().".txt"; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl

Joomla 2.5 login with curl

自古美人都是妖i 提交于 2021-01-28 04:57:16
问题 I'm trying remotely access joomla 2.5 with curl in php. Later I want to create new content too, but for now i have troubles with login. For me is curl new so I don't know what am I doing wrong. I get this message: "Your session has expired. Please log in again.". Here is my code so far: $url = "http://localhost/joomla25/administrator/"; $cookie = "tmp/cookie".time().".txt"; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl

Write data with a PUT request with Ansible URI module

坚强是说给别人听的谎言 提交于 2021-01-28 04:53:41
问题 I'm just trying to translate this cURL call to ansible playbook. cURL call: curl -X PUT -d "value={aa}" "http://172.31.64.174:2379/v2/keys/coreos.com/network/config" Ansible playbook: - uri: url: "http://172.31.64.174:2379/v2/keys/coreos.com/network/config" method: PUT body: "value={aa}" I tried this one but server receive the PUT petition but value is not changed. This is the verbose output from the cURL procedure: * Trying 172.31.64.174... * Connected to 172.31.64.174 (172.31.64.174) port

SSL Connect Error in Curl and Php 5.3.3

本秂侑毒 提交于 2021-01-28 03:54:58
问题 My site worked perfectly since 3 years, with below code, now suddenly since 2 days it started giving below error : SSL Connect error :- in Curl_error Below is my code : <?php $this->ssl_cert = "path_to_my_cert.pem"; $session = curl_init($this->server_url); curl_setopt($session, CURLOPT_HTTPHEADER, $this->request_header); curl_setopt($session, CURLOPT_HEADER, true); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); curl_setopt($session, CURLOPT_TIMEOUT, 300); curl_setopt ($session, CURLOPT

Scrap password protected asp page

大憨熊 提交于 2021-01-28 02:54:44
问题 I would like to develop automatic scrapper for asp password protected web page. I have a login/password for this page. First of all, a look in to Firebug log during authorization via firefox. What I have found: When I open login page, I get cookie with "__RequestVerificationToken". i.e http://mysite When I press Login button FF makes POST query to http://mysite/Account/Login with parameters UserName, Password and __RequestVerificationToken, also it uses cookie saved on step 1 In case of

cURL POST file to OneDrive

[亡魂溺海] 提交于 2021-01-28 01:54:57
问题 I'm trying to upload a file to a users folder on OneDrive using their API. $cfile = curl_file_create(realpath($_POST['ppt-file'])); //place file in folder $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://apis.live.net/v5.0/". $my_folder ."/files?access_token=" . $access_token); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $cfile); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $upload_result = trim(curl_exec($ch)); curl_close($ch); I get a response from

Firebase Cloud Firestore REST api authentication with only WEB API key?

[亡魂溺海] 提交于 2021-01-28 00:00:46
问题 I'm trying to insert a new record in a Firebase Cloud Firestore database via its REST API and curl. Reading from the database is working as expected since the operation is public. Create operation is not listed in the database rules and it is performed only server side, but I'm unable to do it using only the project API KEY. Take for example the following curl request: curl --header "Content-Type: application/json" \ --request POST \ --data '{"fields":{"myField": {"stringValue": "test"}}}' \

DOMDocument::save[domdocument.save]: failed to open stream: Permission denied

怎甘沉沦 提交于 2021-01-27 20:32:23
问题 I have a code which would save an XML file to my directory. It is actually works like a charm in my localhost & in my shared host BUT its not working in my Linux VPS. I always got this error: Warning: DOMDocument::save(/home/admin/xxxxxx) [domdocument.save]: failed to open stream: Permission denied in /home/admin/xxxxx on line 240 What can I do now? I have chmod 777 the directory and still not working... 回答1: You probably don't have the right to write something in this folder , even if the

Php curl login with csrf token

有些话、适合烂在心里 提交于 2021-01-27 19:48:49
问题 I want to simulate login with curl in php with csrf token. I know the token is refreshed every session and I need to use the same cookie and I do it like this: <?php use Symfony\Component\DomCrawler\Crawler; require 'vendor/autoload.php'; function login($url,$data){ $login = curl_init(); curl_setopt($login, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($login, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($login, CURLOPT_TIMEOUT, 40000); curl_setopt($login, CURLOPT_RETURNTRANSFER, TRUE);

Separate hostname and path in cURL

和自甴很熟 提交于 2021-01-27 19:09:50
问题 Is there a way to separate the hostname and path when using cURL? I would like to make a request to the server itself, not on a particular resource, as described below by IETF: The four options for Request-URI are dependent on the nature of the request. The asterisk "*" means that the request does not apply to a particular resource, but to the server itself, and is only allowed when the method used does not necessarily apply to a resource. One example would be OPTIONS * HTTP/1.1 http://tools