Trouble With cURL

He has: 5 posts

Joined: May 2005

I have the following code on a web page:

<?php

$user_name
= "";
$user_pass = "";
$stats_for = "";

// login and store cookie data
$cookielocation = "socomcookies.txt";
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookielocation);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookielocation);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Stat Scraper');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$url = "https://socom3html-prod.svo.pdonline.scea.com:10079/SOCOM3_HTML/account/Account_Login_Submit.jsp";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "userName=" . $user_name . "&passWord=" . $user_pass);

// display actual output of the first page
$content = curl_exec($ch);
$content = ereg_replace('"/', '"http://socom3html-prod.svo.pdonline.scea.com:10070/', $content);
echo
$content;

sleep(2);

// get actual data
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookielocation);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookielocation);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Stat Scraper');
$url = "http://socom3html-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/stats/Stats_CareerSearch_Submit.jsp?userName=" . $stats_for . "&gameMode=0";
curl_setopt($ch, CURLOPT_URL, $url);

// display actual output of the second page
$content = curl_exec($ch);
$content = ereg_replace('"/', '"http://socom3html-prod.svo.pdonline.scea.com:10070/', $content);
echo
$content;

?>
'
Off hand can anyone tell me why this code is not working? I know it's hard to tell without a username and password. The cookie information isn't storing in the file I made. Let me know if you need more explanation.

Southern Maryland Real Estate | Maryland Relocation Specialist | [url=http://www.homesearch-md.com[/url]Southern Maryland Home Search[/url]

They have: 10 posts

Joined: May 2003

r u sure the curl package on your server supporting https connection ?
you need curl ssl installed if you want to open a website which required ssl connection into it Smiling

oh, may i know the error code you got ?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.