trophy | 18 Jan 2012 16:39
Picon
Favicon

Help

Hi Please can you have a look at this it did work 2 month ago but now i just get Connection problem.
it get info to my signature i have on my site!
<?php
class IdsManager
{
private $login = "mail adress";
private $pw = "xxxxxxxxxx";
private $authId;
private $playerId;
private $authIdFile;
private $player;
public function __construct($playerName)
{
$this->authIdFile = fopen('ramdisk/authid', 'r');
$this->authId = fgets($this->authIdFile);
$this->retrieveAuthAndPlayerId($playerName);
$this->player = $playerName;
fclose($this->authIdFile);
}
private function connection()
{
$usermail = urlencode($this->login);
$password = urlencode($this->pw);
$post = "email=".$usermail."&password=".$password."&frm_action=login";
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$header = curl_getinfo( $ch );
curl_close($ch);
unset($ch);
$securestr = explode("/", $header['url']);
$this->authId = $securestr[4];
fclose($this->authIdFile);
$this->authIdFile = fopen('./ramdisk/authid', 'w');
fseek($this->authIdFile, 0);
fputs($this->authIdFile, $this->authId);
}
private function retrieveAuthAndPlayerId($playerName)
{
if(empty($this->authId))
{
$this->connection();
}
$this->retrievePlayerIdFromSite($playerName);
if($this->playerId === 0)
{
$this->connection();
$this->retrievePlayerIdFromSite($playerName);
}
}
private function retrievePlayerIdFromSite($playerName)
{
$ch = curl_init("http://"/.$playerName.".thehunter.com/sid/".$this->authId."/site/statistics/");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$response = curl_exec($ch);
$header = curl_getinfo( $ch );
curl_close($ch);
unset($ch);
if(strpos($header['url'], "reason=no-profile-exists"))
{
$this->playerId = -1;
} elseif($header['url'] == "http://www.thehunter.com/pub/")
{
$this->playerId = 0;
} else {
$useridpos = strpos($response, "onclick=") + 12;
$this->playerId = substr($response, $useridpos, 11);
}
}
public function getPlayerId()
{
return $this->playerId;
}
public function getAuthId()
{
return $this->authId;
}
public function getPlayerName()
{
return $this->player;
}
public function isValid()
{
return (!empty($this->authId) && !empty($this->playerId) && $this->playerId != -1);
}
}
?>
Hope you can help me out with this....it did work 2 months ago!
Regards
Anders
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
shiplu | 18 Jan 2012 19:50
Picon
Gravatar

Re: Help


How did you find its not working?
Any error? Anything unexpected happened?
Need more information.
--
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
trophy | 18 Jan 2012 21:21
Picon
Favicon

Help

i get only a erro like this
Connection problem
And why i did notice it was my signature did not updates and i did hear they have change some in root of that site...and how to find out that i have no clue i did pay for that signature creator
and the coder have dissepear and cant get in touch with him
Please hope you can help me
Regards
Anders
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
trophy | 18 Jan 2012 21:36
Picon
Favicon

Re: Help

 
Hi!
i get only a erro like this
Connection problem
And why i did notice it was my signature did not updates and i did hear they have change some in root of that site...and how to find out that i have no clue i did pay for that signature creator
and the coder have dissepear and cant get in touch with him
Please hope you can help me
Regards
Anders
 
From: shiplu
Sent: Wednesday, January 18, 2012 7:50 PM
Subject: Re: Help
 

How did you find its not working?
Any error? Anything unexpected happened?
Need more information.
--
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
shiplu | 19 Jan 2012 06:27
Picon
Gravatar

Re: Help

Show us some code that reproduces the error. How do you call this class that produces the error?

--
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
trophy | 19 Jan 2012 10:56
Picon
Favicon

Re: Help

[19-Jan-2012 10:54:07] PHP Notice:  Undefined offset: 4 in /home/shadowhu/public_html/ddt/modules/Sig/IdsManager.class.php on line 45
 
 
$this->authId = $securestr[4];
 
That is the erro and code under
 
Connection problem.
 
Thats all
 
Regards
Anders
 
 
From: shiplu
Sent: Thursday, January 19, 2012 6:27 AM
Subject: Re: Help
 
Show us some code that reproduces the error. How do you call this class that produces the error?

--
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
yong wang | 20 Jan 2012 01:16
Picon

Re: Help

Hi,The problem is that Url was changed perhaps.
if it changed from http://secure.thehunter.com/submit/
to http://secure.thehunter.com/.
You should change $this->authId = $securestr[4];
to $this->authId = $securestr[3];

Hope This Helps You

Regards
wy

2012/1/19, trophy <at> tele2.se <trophy <at> tele2.se>:
> Hi Please can you have a look at this it did work 2 month ago but now i just
> get Connection problem.
> it get info to my signature i have on my site!
> <?php
> class IdsManager
> {
> private $login = "mail adress";
> private $pw = "xxxxxxxxxx";
> private $authId;
> private $playerId;
> private $authIdFile;
> private $player;
> public function __construct($playerName)
> {
> $this->authIdFile = fopen('ramdisk/authid', 'r');
> $this->authId = fgets($this->authIdFile);
> $this->retrieveAuthAndPlayerId($playerName);
> $this->player = $playerName;
> fclose($this->authIdFile);
> }
> private function connection()
> {
> $usermail = urlencode($this->login);
> $password = urlencode($this->pw);
> $post = "email=".$usermail."&password=".$password."&frm_action=login";
> $ch = curl_init("http://secure.thehunter.com/submit/");
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> $response = curl_exec($ch);
> $header = curl_getinfo( $ch );
> curl_close($ch);
> unset($ch);
> $securestr = explode("/", $header['url']);
> $this->authId = $securestr[4];
> fclose($this->authIdFile);
> $this->authIdFile = fopen('./ramdisk/authid', 'w');
> fseek($this->authIdFile, 0);
> fputs($this->authIdFile, $this->authId);
> }
> private function retrieveAuthAndPlayerId($playerName)
> {
> if(empty($this->authId))
> {
> $this->connection();
> }
> $this->retrievePlayerIdFromSite($playerName);
> if($this->playerId === 0)
> {
> $this->connection();
> $this->retrievePlayerIdFromSite($playerName);
> }
> }
> private function retrievePlayerIdFromSite($playerName)
> {
> $ch =
> curl_init("http://"/.$playerName.".thehunter.com/sid/".$this->authId."/site/statistics/");
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_HEADER, 1);
> $response = curl_exec($ch);
> $header = curl_getinfo( $ch );
> curl_close($ch);
> unset($ch);
> if(strpos($header['url'], "reason=no-profile-exists"))
> {
> $this->playerId = -1;
> } elseif($header['url'] == "http://www.thehunter.com/pub/")
> {
> $this->playerId = 0;
> } else {
> $useridpos = strpos($response, "onclick=") + 12;
> $this->playerId = substr($response, $useridpos, 11);
> }
> }
> public function getPlayerId()
> {
> return $this->playerId;
> }
> public function getAuthId()
> {
> return $this->authId;
> }
> public function getPlayerName()
> {
> return $this->player;
> }
> public function isValid()
> {
> return (!empty($this->authId) && !empty($this->playerId) && $this->playerId
> != -1);
> }
> }
> ?>
> Hope you can help me out with this....it did work 2 months ago!
> Regards
> Anders
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

trophy | 20 Jan 2012 01:56
Picon
Favicon

Re: Help

still same problem :-(

-----Ursprungligt meddelande----- 
From: yong wang
Sent: Friday, January 20, 2012 1:16 AM
To: curl with PHP
Subject: Re: Help

Hi,The problem is that Url was changed perhaps.
if it changed from http://secure.thehunter.com/submit/
to http://secure.thehunter.com/.
You should change $this->authId = $securestr[4];
to $this->authId = $securestr[3];

Hope This Helps You

Regards
wy

2012/1/19, trophy <at> tele2.se <trophy <at> tele2.se>:
> Hi Please can you have a look at this it did work 2 month ago but now i 
> just
> get Connection problem.
> it get info to my signature i have on my site!
> <?php
> class IdsManager
> {
> private $login = "mail adress";
> private $pw = "xxxxxxxxxx";
> private $authId;
> private $playerId;
> private $authIdFile;
> private $player;
> public function __construct($playerName)
> {
> $this->authIdFile = fopen('ramdisk/authid', 'r');
> $this->authId = fgets($this->authIdFile);
> $this->retrieveAuthAndPlayerId($playerName);
> $this->player = $playerName;
> fclose($this->authIdFile);
> }
> private function connection()
> {
> $usermail = urlencode($this->login);
> $password = urlencode($this->pw);
> $post = "email=".$usermail."&password=".$password."&frm_action=login";
> $ch = curl_init("http://secure.thehunter.com/submit/");
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> $response = curl_exec($ch);
> $header = curl_getinfo( $ch );
> curl_close($ch);
> unset($ch);
> $securestr = explode("/", $header['url']);
> $this->authId = $securestr[4];
> fclose($this->authIdFile);
> $this->authIdFile = fopen('./ramdisk/authid', 'w');
> fseek($this->authIdFile, 0);
> fputs($this->authIdFile, $this->authId);
> }
> private function retrieveAuthAndPlayerId($playerName)
> {
> if(empty($this->authId))
> {
> $this->connection();
> }
> $this->retrievePlayerIdFromSite($playerName);
> if($this->playerId === 0)
> {
> $this->connection();
> $this->retrievePlayerIdFromSite($playerName);
> }
> }
> private function retrievePlayerIdFromSite($playerName)
> {
> $ch =
> curl_init("http://"/.$playerName.".thehunter.com/sid/".$this->authId."/site/statistics/");
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_HEADER, 1);
> $response = curl_exec($ch);
> $header = curl_getinfo( $ch );
> curl_close($ch);
> unset($ch);
> if(strpos($header['url'], "reason=no-profile-exists"))
> {
> $this->playerId = -1;
> } elseif($header['url'] == "http://www.thehunter.com/pub/")
> {
> $this->playerId = 0;
> } else {
> $useridpos = strpos($response, "onclick=") + 12;
> $this->playerId = substr($response, $useridpos, 11);
> }
> }
> public function getPlayerId()
> {
> return $this->playerId;
> }
> public function getAuthId()
> {
> return $this->authId;
> }
> public function getPlayerName()
> {
> return $this->player;
> }
> public function isValid()
> {
> return (!empty($this->authId) && !empty($this->playerId) && 
> $this->playerId
> != -1);
> }
> }
> ?>
> Hope you can help me out with this....it did work 2 months ago!
> Regards
> Anders
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php 

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

yong wang | 23 Jan 2012 01:23
Picon

Re: Help

you change the sourse from

$header = curl_getinfo( $ch );
curl_close($ch);

to

if(!curl_errno($ch))
{
 $info = curl_getinfo($ch);
 echo 'Took ' . $info['total_time'] . ' seconds to send a request to '
. $info['url'];
}
curl_close($ch);
exit();

run it and what's output?

2012/1/20, trophy <at> tele2.se <trophy <at> tele2.se>:
> still same problem :-(
>
> -----Ursprungligt meddelande-----
> From: yong wang
> Sent: Friday, January 20, 2012 1:16 AM
> To: curl with PHP
> Subject: Re: Help
>
> Hi,The problem is that Url was changed perhaps.
> if it changed from http://secure.thehunter.com/submit/
> to http://secure.thehunter.com/.
> You should change $this->authId = $securestr[4];
> to $this->authId = $securestr[3];
>
> Hope This Helps You
>
> Regards
> wy
>
>
>
> 2012/1/19, trophy <at> tele2.se <trophy <at> tele2.se>:
>> Hi Please can you have a look at this it did work 2 month ago but now i
>> just
>> get Connection problem.
>> it get info to my signature i have on my site!
>> <?php
>> class IdsManager
>> {
>> private $login = "mail adress";
>> private $pw = "xxxxxxxxxx";
>> private $authId;
>> private $playerId;
>> private $authIdFile;
>> private $player;
>> public function __construct($playerName)
>> {
>> $this->authIdFile = fopen('ramdisk/authid', 'r');
>> $this->authId = fgets($this->authIdFile);
>> $this->retrieveAuthAndPlayerId($playerName);
>> $this->player = $playerName;
>> fclose($this->authIdFile);
>> }
>> private function connection()
>> {
>> $usermail = urlencode($this->login);
>> $password = urlencode($this->pw);
>> $post = "email=".$usermail."&password=".$password."&frm_action=login";
>> $ch = curl_init("http://secure.thehunter.com/submit/");
>> curl_setopt($ch, CURLOPT_HEADER, 1);
>> curl_setopt($ch, CURLOPT_POST, 1);
>> curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
>> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>> $response = curl_exec($ch);
>> $header = curl_getinfo( $ch );
>> curl_close($ch);
>> unset($ch);
>> $securestr = explode("/", $header['url']);
>> $this->authId = $securestr[4];
>> fclose($this->authIdFile);
>> $this->authIdFile = fopen('./ramdisk/authid', 'w');
>> fseek($this->authIdFile, 0);
>> fputs($this->authIdFile, $this->authId);
>> }
>> private function retrieveAuthAndPlayerId($playerName)
>> {
>> if(empty($this->authId))
>> {
>> $this->connection();
>> }
>> $this->retrievePlayerIdFromSite($playerName);
>> if($this->playerId === 0)
>> {
>> $this->connection();
>> $this->retrievePlayerIdFromSite($playerName);
>> }
>> }
>> private function retrievePlayerIdFromSite($playerName)
>> {
>> $ch =
>> curl_init("http://"/.$playerName.".thehunter.com/sid/".$this->authId."/site/statistics/");
>> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>> curl_setopt($ch, CURLOPT_HEADER, 1);
>> $response = curl_exec($ch);
>> $header = curl_getinfo( $ch );
>> curl_close($ch);
>> unset($ch);
>> if(strpos($header['url'], "reason=no-profile-exists"))
>> {
>> $this->playerId = -1;
>> } elseif($header['url'] == "http://www.thehunter.com/pub/")
>> {
>> $this->playerId = 0;
>> } else {
>> $useridpos = strpos($response, "onclick=") + 12;
>> $this->playerId = substr($response, $useridpos, 11);
>> }
>> }
>> public function getPlayerId()
>> {
>> return $this->playerId;
>> }
>> public function getAuthId()
>> {
>> return $this->authId;
>> }
>> public function getPlayerName()
>> {
>> return $this->player;
>> }
>> public function isValid()
>> {
>> return (!empty($this->authId) && !empty($this->playerId) &&
>> $this->playerId
>> != -1);
>> }
>> }
>> ?>
>> Hope you can help me out with this....it did work 2 months ago!
>> Regards
>> Anders
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

trophy | 23 Jan 2012 06:34
Picon
Favicon

Re: Help

I get this so it does connect Took 0.828416 seconds to send a request to 
http://birdhunter2.thehunter.com/
but i dont get the info??

and with out your code i get Connection problem.

Regards
Anders

-----Ursprungligt meddelande----- 
From: yong wang
Sent: Monday, January 23, 2012 1:23 AM
To: curl with PHP
Subject: Re: Help

you change the sourse from

$header = curl_getinfo( $ch );
curl_close($ch);

to

if(!curl_errno($ch))
{
$info = curl_getinfo($ch);
echo 'Took ' . $info['total_time'] . ' seconds to send a request to '
. $info['url'];
}
curl_close($ch);
exit();

run it and what's output?

2012/1/20, trophy <at> tele2.se <trophy <at> tele2.se>:
> still same problem :-(
>
> -----Ursprungligt meddelande-----
> From: yong wang
> Sent: Friday, January 20, 2012 1:16 AM
> To: curl with PHP
> Subject: Re: Help
>
> Hi,The problem is that Url was changed perhaps.
> if it changed from http://secure.thehunter.com/submit/
> to http://secure.thehunter.com/.
> You should change $this->authId = $securestr[4];
> to $this->authId = $securestr[3];
>
> Hope This Helps You
>
> Regards
> wy
>
>
>
> 2012/1/19, trophy <at> tele2.se <trophy <at> tele2.se>:
>> Hi Please can you have a look at this it did work 2 month ago but now i
>> just
>> get Connection problem.
>> it get info to my signature i have on my site!
>> <?php
>> class IdsManager
>> {
>> private $login = "mail adress";
>> private $pw = "xxxxxxxxxx";
>> private $authId;
>> private $playerId;
>> private $authIdFile;
>> private $player;
>> public function __construct($playerName)
>> {
>> $this->authIdFile = fopen('ramdisk/authid', 'r');
>> $this->authId = fgets($this->authIdFile);
>> $this->retrieveAuthAndPlayerId($playerName);
>> $this->player = $playerName;
>> fclose($this->authIdFile);
>> }
>> private function connection()
>> {
>> $usermail = urlencode($this->login);
>> $password = urlencode($this->pw);
>> $post = "email=".$usermail."&password=".$password."&frm_action=login";
>> $ch = curl_init("http://secure.thehunter.com/submit/");
>> curl_setopt($ch, CURLOPT_HEADER, 1);
>> curl_setopt($ch, CURLOPT_POST, 1);
>> curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
>> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>> $response = curl_exec($ch);
>> $header = curl_getinfo( $ch );
>> curl_close($ch);
>> unset($ch);
>> $securestr = explode("/", $header['url']);
>> $this->authId = $securestr[4];
>> fclose($this->authIdFile);
>> $this->authIdFile = fopen('./ramdisk/authid', 'w');
>> fseek($this->authIdFile, 0);
>> fputs($this->authIdFile, $this->authId);
>> }
>> private function retrieveAuthAndPlayerId($playerName)
>> {
>> if(empty($this->authId))
>> {
>> $this->connection();
>> }
>> $this->retrievePlayerIdFromSite($playerName);
>> if($this->playerId === 0)
>> {
>> $this->connection();
>> $this->retrievePlayerIdFromSite($playerName);
>> }
>> }
>> private function retrievePlayerIdFromSite($playerName)
>> {
>> $ch =
>> curl_init("http://"/.$playerName.".thehunter.com/sid/".$this->authId."/site/statistics/");
>> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
>> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>> curl_setopt($ch, CURLOPT_HEADER, 1);
>> $response = curl_exec($ch);
>> $header = curl_getinfo( $ch );
>> curl_close($ch);
>> unset($ch);
>> if(strpos($header['url'], "reason=no-profile-exists"))
>> {
>> $this->playerId = -1;
>> } elseif($header['url'] == "http://www.thehunter.com/pub/")
>> {
>> $this->playerId = 0;
>> } else {
>> $useridpos = strpos($response, "onclick=") + 12;
>> $this->playerId = substr($response, $useridpos, 11);
>> }
>> }
>> public function getPlayerId()
>> {
>> return $this->playerId;
>> }
>> public function getAuthId()
>> {
>> return $this->authId;
>> }
>> public function getPlayerName()
>> {
>> return $this->player;
>> }
>> public function isValid()
>> {
>> return (!empty($this->authId) && !empty($this->playerId) &&
>> $this->playerId
>> != -1);
>> }
>> }
>> ?>
>> Hope you can help me out with this....it did work 2 months ago!
>> Regards
>> Anders
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php 

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php


Gmane