Re: Validating a link in php

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Validating a link in php
Groups: php.general 
Request: Send a blank email to php-general+get-247757@lists.php.net to get a copy of this message
Richard Lynch wrote: >I dunno what you did wrong with fsockopen... First of all, thanks for taking the time to respond. I had tried fsockopen, but here's the problem. The following calls work as expected, returning a valid file pointer for valid urls and FALSE for invalid urls: $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); $fp = fsockopen("www.youtube.com", 80, $errno, $errstr, 30); $fp = fsockopen("www.this_url_is_not_valid.com", 80, $errno, $errstr, 30); The call below does not work and always returns FALSE. If I enter the url in a web browser, it works fine, but fsockopen does not like it. $fp = fsockopen("www.youtube.com/v/JqO8ZevPJNk", 80, $errno, $errstr, 30); I think it has something to do with the way YouTube works. Any clues? Robert Porter

« previous php.general (#247757) next »