FREAD, COPY, ERROR
Posted: Sat Sep 29, 2007 12:42 pm
hi everyone
i hope some one can answer me,
i have writen a code to work as a proxy and get the data and put the data in a varialble for my future use.
ok
here is the code
this script works perfect and does what i want.
BUT (here comes the problem)
it only works if the page HTTP status is 200/OK , i need this to work when the HTTP is 500 (internal error).
i want to see the error that the page gives when submiting a bad url, ..
please help me solve my problem,,
i hope some one can answer me,
i have writen a code to work as a proxy and get the data and put the data in a varialble for my future use.
ok
here is the code
Code: Select all
if (isset($_POST['Submit'])){
$url=$_POST['ads'];
$contents = '';
while (!feof($url)) {
$contents .= fread($url, 8192);
}
fclose($url);
}BUT (here comes the problem)
it only works if the page HTTP status is 200/OK , i need this to work when the HTTP is 500 (internal error).
i want to see the error that the page gives when submiting a bad url, ..
please help me solve my problem,,