Reading Response from URL
Posted: Mon Nov 07, 2005 5:04 pm
hello all,
I`m am expecting to submit a migration info to a remote URL which will then migrate the information
my php code that automatically send the info through a loop (thanks to sami and Yum jelly) looks like this:
the target.php file is the file that will insert the record on their end.
Instructions given by thrid party company (where the data is being sent) says:
A successful migration will result in this response:
errorCode=0
errorMsg=None
If there is a problem, the response will be:
errorCode=1 (or other appropriate numeric value)
errorMsg=Description of error
my problem here is how do i read the response. do I simply make use of $_REQUEST to get the appropriate values? Any suggestion plz?
Is it possible for me to simulate this on my internal lan....eg the target.php file i`ve written inserts the value submitted in a database. But what shall i return upon successful execution of the insert query?
Thanks in advance
I`m am expecting to submit a migration info to a remote URL which will then migrate the information
my php code that automatically send the info through a loop (thanks to sami and Yum jelly) looks like this:
Code: Select all
<?
ignore_user_abort ( 'true' );
set_time_limit ( 0 );
for ($i=0;$i<10;$i++) //this is just a dummy loop..
{
$html=file_get_contents('http://10.1.1.228/migrate/target.php?i='.$i);
}
?>Instructions given by thrid party company (where the data is being sent) says:
A successful migration will result in this response:
errorCode=0
errorMsg=None
If there is a problem, the response will be:
errorCode=1 (or other appropriate numeric value)
errorMsg=Description of error
my problem here is how do i read the response. do I simply make use of $_REQUEST to get the appropriate values? Any suggestion plz?
Is it possible for me to simulate this on my internal lan....eg the target.php file i`ve written inserts the value submitted in a database. But what shall i return upon successful execution of the insert query?
Thanks in advance