All pastes #1263696 Raw Edit

Anonymous

public php v1 · immutable
#1263696 ·published 2008-11-21 19:23 UTC
rendered paste body
<?php	include('./class/demande/mysql.php');$sql = mysql_query("SELECT url FROM `uploads` WHERE `id_categorie` =1");/******************************************************************************//*                                                                            *//*                       __        ____                                       *//*                 ___  / /  ___  / __/__  __ _____________ ___               *//*                / _ \/ _ \/ _ \_\ \/ _ \/ // / __/ __/ -_|_-<               *//*               / .__/_//_/ .__/___/\___/\_,_/_/  \__/\__/___/               *//*              /_/       /_/                                                 *//*                                                                            *//*                                                                            *//******************************************************************************//*                                                                            *//* Titre          : Vrifier la validit d'une adresse URL.                   *//*                                                                            *//* URL            : http://www.phpsources.org/scripts92-PHP.htm               *//* Auteur         : PHP Sources                                               *//* Date dition   : 08-11-2004                                                *//*                                                                            *//******************************************************************************///Vrifier la validit d'un adresse URL.//Permet d'afficher un message si le lien d'une URL est valide ou non.// L'URL du site web$site = 'http://dl.free.fr/qZfRuEC8/az.avi';$psite = parse_url($site);$file = fsockopen($psite['host'],empty($psite['port'])?80 : $psite['port'],$errno,$errstr); if (!$file){    echo "$errstr ($errno)<br />\n";}else{$req = "GET ".$psite['path']."?".$psite['query']." HTTP/1.1\r\n";$req .= "Host: ".$psite['host']."\r\n";$req .= "Connection: Close\r\n\r\n";fwrite($file,$req);$resp = '';while(!feof($file))	$resp .= fread($file,128);fclose($file);$file = NULL;unset($file);$parse = explode("\r\n\r\n",$resp);//print_r($parse);$code = sscanf($parse[0], "HTTP/%*s %d");echo $code[0];}?>