Please, I need help with curl and php
| From: | Marco Vallejo | Date: | Tue, 29 Jul 2008 14:31:10 +0000 |
| Subject: | Please, I need help with curl and php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-277423@lists.php.net to get a copy of this message | ||
Hi, I´m making a little application with php and curl, but I´m a newby with
curl.
Please help me with the next script.
I used to use this in order to make a connection with an specific site on
the console ms-dos (windows), how can i translate this into php code?
curl -x proxy_url:proxy_port -U proxy_user:proxy_pass --cert
cert.pem:cert_pass --cert-type PEM -k -c cookie.txt -d
"txtUser=user_loguin&txtPass=pass_loguin"
url_required<https://renat.segob.gob.mx/AppRNT/validacion/valida.php>
I tried with this, but it doesn't work fine
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, $f_path);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxurl);
curl_setopt($ch,CURLOPT_PROXYPORT,$proxport);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, $fichero);
curl_setopt($ch, CURLOPT_PROXYUSERPWD,
"'".$proxyu.":".$proxyp."'");
curl_setopt($ch,CURLOPT_SSLCERT,$fichero);
curl_setopt($ch,CURLOPT_SSLCERTTYPE, "pem");
curl_setopt($ch,CURLOPT_SSLCERTPASSWD,$pcert);
curl_setopt($ch,CURLOPT_USERPWD,"'".$usr.":".$pwd."'");
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
$HTTP_Response1 = curl_exec($ch);
Thanks and recards