homepage Welcome to WebmasterWorld Guest from 184.72.82.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
code detect broken link and redirect
code detect broken link
wnshops




msg:4383026
 1:09 pm on Nov 3, 2011 (gmt 0)

I need help
1. What is code detect links and redirect new link
2 . What is code detect image no longer available and display a new image
.thank

 

rocknbil




msg:4383098
 4:38 pm on Nov 3, 2011 (gmt 0)

Well, I don't have code but there's a number of ways to do it . . .

1. What is code detect links and redirect new link


You could pipe it through a script and read the headers, if you get a 404, redirect.

2 . What is code detect image no longer available and display a new image


If the file is on your server, easy:

if (!is_file($_SERVER['DOCUMENT_ROOT'] . "/$img")) {
$img = $default_img;
}

If it's a remote image, I'd use the same method as in #1.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved