Jump to content

Check if a website exists and if so, create a link


jamesvasey

Recommended Posts

I want to provide a link to a users public_html directory from our companies intranet, but only if it exists for the user. (as not all users have a public_html, and i dont want them to end up in error404)

i.e. user: bob (logged in using http_auth) PHP checks to see if [a href=\"http://servername/~bob\" target=\"_blank\"]http://servername/~bob[/a] exists, if it does then show a link, if it doesnt (Error 404) then don't show the link.

The public_html's are on a different server, so I cant look at the local hard disk.

Any ideas? I am guessing some form of wget, followed by an if statement (depending on an error 404).

Thanks
James
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.