Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

vérifier un lien php

Featured Replies

Posté(e)

voici une fonction qui permet de vérifier des liens seulement elle ne marche pas elle me met tous le temps que le lien est valide ou bien il me met une erreur :

Notice: Undefined index: port in c:\////\check.php on line 54

<lien>http://www.hotmaifgl.com</lien> file exists!

<?php
function url_validate( $link )
{
$url_parts = @parse_url( $link );

if ( empty( $url_parts["host"] ) ) return( false );

if ( !empty( $url_parts["path"] ) )
{
$documentpath = $url_parts["path"];
}
else
{
$documentpath = "/";
}

if ( !empty( $url_parts["query"] ) )
{
$documentpath .= "?" . $url_parts["query"];
}

$host = $url_parts["host"];
$port = $url_parts["port"];


if (empty( $port ) ) $port = "80";
$socket = @fsockopen( $host, $port, $errno, $errstr, 30 );
if (!$socket)
{
return(false);
}
else
{
fwrite ($socket, "HEAD ".$documentpath." HTTP/1.0\r\nHost: $host\r\n\r\n");
$http_response = fgets( $socket, 22 );

if ( ereg("200 OK", $http_response, $regs ) )
{
return(true);
fclose( $socket );
} else
{
return(false);
}
}
}

$link = "http://www.hotmaifgl.com";
if (url_validate( $link )==false)
{ print ($link . " file exists!"); }
else
{ print ($link . " file doesn't exist!"); }
?>

que faire ??? Connaissez vous un script qui check les urls et qui soit fillable ( prenant en charge les erreurs ) ??

merci beaucoup d'avance

Posté(e)

sinon le problème dans ton code c'est que tu défini $url_parts["port"] si je comprend bien

c'est juste une notice, il faut utilise error_reporting(E_ALL~E_NOTICE); pour pas voir ces erreurs ( affiche les seulement pour le débuguage )

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.