- file_get_contents: documentation ( source)
- file_exists: documentation ( source)
<?php
$nice = 1;
$u = 'data://,Good Work!';
if (!isset ($u)) $nice = 0;
if (ereg ('\.', $u)) $nice = 0;
if (ereg ('%', $u)) $nice = 0;
if (ereg ('[0-9]', $u)) $nice = 0;
if (ereg ('http', $u) ) $nice = 0;
if (ereg ('https', $u) ) $nice = 0;
if (ereg ('ftp', $u)) $nice = 0;
if (ereg ('telnet', $u)) $nice = 0;
if ($nice) {
if (@file_exists ($u)) $nice = 0;
}
if ($nice) {
$nice = @file_get_contents ($u);
if ($nice === 'Good Work!') echo 'ok';
}
?>