SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checking remote pages exist

    I need to check if several pages on a remote server exist or not. file_get_contents works sometimes, but other at other times fails with HTTP request failed! HTTP/1.0 403 Forbidden in... This despite the page existing, and despite my having succesfully checked for other pages on the very same server.

    Is there any reliable way of achieving this?

  2. #2
    SitePoint Zealot Bill Palmer's Avatar
    Join Date
    Oct 2005
    Location
    London, UK
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    fopen() or, if available, curl.

    Good luck.

  3. #3
    SitePoint Addict pkSML's Avatar
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Curl is the fastest connection to a server that I know of.

    Just execute a HTTP HEAD command, rather than a GET command to retrieve the status code.
    -Stephen

    Get a LitlURL to this page!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •