- Impact
- 49
php 4 vs php 5
This piece of code output "The requested URL is invalid" for php 4 server.
but this doen't work for php 5 server, it returns nothing.
How to rewrite this piece of code to work under php 5 server?
Thanks in advance!!!
Code:
if( $fd = @fopen($theDomain.$page, "r") )
{
$value = "";
while(!feof($fd)){
$value .= fread($fd, 4096);
}
fclose($fd);
}
else {
echo "The requested URL is invalid.";
}
This piece of code output "The requested URL is invalid" for php 4 server.
but this doen't work for php 5 server, it returns nothing.
How to rewrite this piece of code to work under php 5 server?
Thanks in advance!!!