Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Detect Missing Download Files


  • Please log in to reply
3 replies to this topic

#1 piskie

piskie

    HR 7

  • Active Members
  • PipPipPipPipPipPipPip
  • 1,098 posts
  • Location:Cornwall

Posted 14 September 2010 - 05:00 AM

I am building a small technical reference library probably 300 to 500 mainly PDF documents. The Title, description etc is held in the Db and the file is uploaded using the same form that inserts the record.
Now at times, it is inevitable that a record will exist without a PDF file on the end of the download link.

What I would like is some form of detection method that (within a page with 10 to 50 Links) spots a link with no file present. I can then use this "Flag" to highlight the missing file by say colouring the Link Text or something.
Speed is not a factor as this would be located within the Admin area so that these error situations can be spotted and rectified.

The error detection pages and PDF files will be in neighbouring directories.
I am using PHP with MYSQL and have full access to htaccess.
Any help or suggestion would be most welcome.

#2 Mooro

Mooro

    HR 4

  • Active Members
  • PipPipPipPip
  • 157 posts
  • Location:Loughborough, Leicestershire

Posted 14 September 2010 - 08:04 AM

if(file_exists()){
echo 'Yeah';
}else{
echo 'Boo';
}

#3 piskie

piskie

    HR 7

  • Active Members
  • PipPipPipPipPipPipPip
  • 1,098 posts
  • Location:Cornwall

Posted 14 September 2010 - 12:41 PM

Thanks Mooro, that is far too obvious. I was searching via Google for combinations of file and missing.


#4 Mooro

Mooro

    HR 4

  • Active Members
  • PipPipPipPip
  • 157 posts
  • Location:Loughborough, Leicestershire

Posted 15 September 2010 - 02:37 AM

I too had done that before I found file_exists, it's a beauty.

Obvious is simple, simple is good!

smile.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!