PHP
Zur Navigation springen
Zur Suche springen
Convert utf8
- !/usr/bin/php -q
<?php
$dir = '.'; $dh = opendir ($dir)
or die ("Fehler beim Oeffnen von $dir...n");
while (($file = readdir($dh)) !== false) {
if (preg_match ('/.txt$/i', $file)) { $infile = fopen ($file, "r"); $outfilename = "$file.utf-8"; $outfile = fopen ($outfilename, "w"); if ($infile and $outfile) { while (!feof ($infile)) { $line = fgets ($infile, 1024); fputs ($outfile, iconv ("ISO-8859-1", "UTF-8", $line)); } fclose ($outfile); fclose ($infile); } }
} closedir ($dh);
?>
Directory listing
<?php
if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "index.php" && $file != ".")
{
$thelist .= '<a href="'.$file.'">'.$file.'
</a>'; } } closedir($handle); }
?>
List of files:
<?=$thelist?>
Passwortschutz
<form method="POST" action="index.php">
Admin Passwort? <input type="password" name="pw" size="14"><input type="submit" value="Submit">
</form>
<? $adminpass = "pass"; if ($pw == $adminpass) { print("Hallo in der Administration!"); include ("a.dat");
}
else
{
print("Falsches Passwort");
}
?>