Re: I want to know if some link is online

From: Date: Mon, 10 Oct 2005 04:36:00 +0000
Subject: Re: I want to know if some link is online
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-223802@lists.php.net to get a copy of this message
Jesús Alain Rodríguez Santos wrote:
I would like to know if a web is online, a have this code: enlace.php <? $vivo = "verde.gif"; $muerto = "rojo.gif"; $enlinea = fopen("$enlace", "r");
Why not use file_exists()? Also, you probably want to use $_GET['enlance'] rather than $enlance.
             if (!$enlinea){
                header("Location: $muerto");
                }
You need to specify an absolute URI here (http://www.example.com/myimage.gif for example). -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/

« previous php.general (#223802) next »