I m facing a problem..
I need to execute a remote php file and get the return value in variable or print that.
but the problem is if I run the remote php file directly (in browser address bar) it works fine (it give new data based on cookies value each time)
but if I try to get that remote php return value using php file_get_contents it does not works good and only return fixed data..
please check out the attached file (source php files) that will help you to understand..
opps! i didn't find way to attach..
ok say this is the remote file:
here is the code for that remote file:
Now say this is the local file (on another domain/server):
$strMainArray = array('01', '05', '06', '07', '09', '11', '12', '14');
$strSubArray = array('02', '03', '04', '08', '10', '13', '15', '16');
$strArray = array_merge($strMainArray, $strSubArray);
//Get App No
$bApp = $_COOKIE["bApp"];
setcookie('bApp', $bApp, time() + (86400 * 180));
if ($bApp == count($strArray))
setcookie('bApp', $bApp + 1, time() + (86400 * 180));
$strInfo = $strArray[$bApp];
so, for example if i run remote file directly on browser address bar:
01, 05, 06 etc (on each run)
but if run the php file that call that remote file though file_get_contents function, it always return 01
i hope i have gave enough information..
please help me out
thanks in advance..