Re: Validating a link in php
| From: | Richard Lynch | Date: | Thu, 25 Jan 2007 00:41:54 +0000 |
| Subject: | Re: Validating a link in php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247741@lists.php.net to get a copy of this message | ||
On Wed, January 24, 2007 10:25 am, sleestak2@earthlink.net wrote:
> I'm hoping y'all can help me with a bit of a php code problem I'm
> having.
>
> What I'm trying to do is link to YouTube videos (more than one in a
> single
> webpage). However, because I'm worried about the videos going away
> and the
> links going bad, I'd like to use PHP to check if the link is good; if
> it's
> good, display the video link, else display a static image that I have
> on my
> servers.
>
> Where I'm having troubles is in the checking of whether the url is
> good. I
> think part of the problem is YouTube itself. I've tried file() and
> fsockopen(), but neither seem to work.
The problem with 'file' is that you are trying to suck down the ENTIRE
video, probably...
I dunno what you did wrong with fsockopen...
I personally would have done fopen and read the headers to see if it
was valid.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?