[Resolved] Php 4 vs Php 5

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

newsiness

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

Thanks, it works!!! :)
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back