Before that, I searched around for problem same as me, but not found any..
I got a url http://mywebsite/rpc.php?stat=22
then, I have this code:
if(isset($_GET['stat'])){
$id = preg_replace("/[^0-9]/", "", $_GET['stat']);
$result = $rpc->get($id);
print_r($result);
}
this code will print array without result.. But, If I modify the code like this :
if(isset($_GET['stat'])){
//$id = preg_replace("/[^0-9]/", "", $_GET['stat']);
$result = $rpc->get(22);
print_r($result);
}
it will print the result as I want.. I tried echoing $_GET,and it output number 22.. is there anybody know what is the problem with my script?
this is the code that will process $rpc->get();
public function get ( $ids = array(), $fields = array() )
{
if ( !is_array( $ids ) ) $ids = array( $ids ); // Convert $ids to an array if only a single id was passed
if ( count( $fields ) == 0 ) $fields = array( "id", "name", "downloadDir", "rateDownload", "status", "doneDate", "haveValid", "totalSize" ); // Defaults
$request = array(
"fields" => $fields,
"ids" => $ids
);
return $this->request( "torrent-get", $request );
}