Checking if a site is available

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Ryan

    Checking if a site is available

    What PHP code would I use to check if submitted sites to my directory
    actually exist?? I want to use something that can return the server
    code to me, ie HTTP 300 OK, or whatever. Can I do this with sockets??
  • Jason Dumler

    #2
    Re: Checking if a site is available

    John,

    Probably the curl library would be a LOT easier to work with. There's
    probably an example of what you are talking about in the documentation
    at php.net. Even shelling out to the curl binary would be easier than
    re-writing the http protocol to see if sites are up.

    Jason

    John Ryan wrote:[color=blue]
    > What PHP code would I use to check if submitted sites to my directory
    > actually exist?? I want to use something that can return the server
    > code to me, ie HTTP 300 OK, or whatever. Can I do this with sockets??[/color]

    Comment

    Working...