Critical Security.NET: Curl Redirection - Critical Security.NET

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Curl Redirection

#1 User is offline   deliverme Icon

  • Regular Member
  • PipPipPip
  • Group: Members
  • Posts: 52
  • Joined: 10-May 06

Posted 05 February 2010 - 02:31 PM

Hello.
Little problem with PHP Curl redirection.
I'm trying to log in to a web-chat usung GET method.

Everything goes well, but the problem is that the url changes to the redirected one when i'm being redirected from chat.example.com/login.php page to
chatserver.example.com/.
So i don't want to be redirected anywhere from my own server.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://chat.example.com/:8080/login?cid=820&nick=deliverme');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'tmp\cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'tmp\cookies.txt');

$result = curl_exec($ch);
$info = curl_getinfo($ch);
echo $info['http_code'];
echo $result;


Thanks.
0

#2 User is offline   DarkGawd Icon

  • Critical Member
  • PipPipPipPip
  • Group: Members
  • Posts: 173
  • Joined: 24-September 06
  • Gender:Male

Posted 07 February 2010 - 10:25 PM

CURLOPT_FOLLOWLOCATION is set to false so it isn't being redirected.

This post has been edited by DarkGawd: 07 February 2010 - 10:28 PM

0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users