NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [resolved] How to fix infinite error looping?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 09-04-2007, 04:40 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Jul 2005
Posts: 1,492
newsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud of
 


AIDS/HIV Save a Life

How to fix infinite error looping?


This is a small portion of my php script which is as shown below:

PHP Code:
$fd fopen($theDomain.$page"r"); 
$value "";
while(!
feof($fd)){
    
$value .= fread($fd4096);    
}
fclose($fd); 
When the script fail to open the domain url, it returns me infinite error looping which you can refer to the snapshot below:
????: NamePros.com http://www.namepros.com/programming/370027-resolved-how-fix-infinite-error-looping.html


Is there anyway, when the script sees the error it returns me like "Page not found" message?

Thanks in advance!!!
__________________
||||newsiness.com||||'""|""\__,_
| _[lol]___[lol]____ l ||__|__|)
|(@)(@)"""""""**|(@)(@)**|(@) 100% Free Online Flash games
newsiness is offline  
Old 09-04-2007, 06:10 AM   #2 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
PHP Code:
if (file_exists($thevar)) { 

$fd fopen($theDomain.$page"r"); 
????: NamePros.com http://www.namepros.com/showthread.php?t=370027
$value "";
while(!
feof($fd)){
    
$value .= fread($fd4096);    
}
fclose($fd);  

Should get you started ^^
Daniel is offline  
Old 09-04-2007, 10:38 AM   #3 (permalink)
NamePros Regular
 
baxter's Avatar
Join Date: Apr 2006
Posts: 363
baxter is just really nicebaxter is just really nicebaxter is just really nicebaxter is just really nice
 


Ethan Allen Fund Save The Children
You can try this either Untested but should surpress the first error and return false on a 404 page.

PHP Code:
if( false !== ( $fd = @fopen($theDomain.$page"r") ) )

   
$value "";
  while(!
feof($fd)){
     
$value .= fread($fd4096);    
  }
fclose($fd);
????: NamePros.com http://www.namepros.com/showthread.php?t=370027

__________________
Canadian Domain Registrar Ready.ca
baxter is offline  
Old 09-04-2007, 01:26 PM   #4 (permalink)
New Member
Join Date: Apr 2006
Posts: 18
elmister is an unknown quantity at this point
 



Or simply

PHP Code:
if(  $fd = @fopen($theDomain.$page"r")  )
????: NamePros.com http://www.namepros.com/showthread.php?t=370027

   
$value "";
  while(!
feof($fd)){
     
$value .= fread($fd4096);    
  }
fclose($fd);

or simplier

PHP Code:
$value=file_get_contents($theDomain.$page); 
On failure $value will be FALSE
elmister is offline  
Old 09-04-2007, 07:47 PM THREAD STARTER               #5 (permalink)
Senior Member
Join Date: Jul 2005
Posts: 1,492
newsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud ofnewsiness has much to be proud of
 


AIDS/HIV Save a Life
Danltn, baxter & elmister,

Thanks...it works!!!!
++Rep added.
__________________
||||newsiness.com||||'""|""\__,_
| _[lol]___[lol]____ l ||__|__|)
|(@)(@)"""""""**|(@)(@)**|(@) 100% Free Online Flash games
newsiness is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 12:52 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger