NameSilo

[Resolved] Php 4 vs Php 5

Spaceship Spaceship
Watch
php 4 vs php 5

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!!!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
PHP:
$value = file_get_contents($theDomain.$page);
if(!$value) {
  echo 'The request URL : ' , $theDomain , $page , ' is invalid.';
}
 
0
•••
Daniel,

Thanks, it works!!! :)
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back