PHP_Commander

From: Date: Tue, 21 Aug 2001 12:44:05 +0000
Subject: PHP_Commander
Groups: php.general 
Request: Send a blank email to php-general+get-63688@lists.php.net to get a copy of this message
Hope this will help. Some code is grabbed from the PHP's quickref. <?php var_dump($HTTP_POST_VARS); if (@!$HTTP_POST_VARS['dir']) $HTTP_POST_VARS['dir']='./'; if (is_dir($HTTP_POST_VARS['dir'])){ echo '<form method="post" action="'.$PHP_SELF.'" name="ok">'; echo "<input type='hidden' name='dir' value='".$HTTP_POST_VARS['dir']."'></form>"; if ($dir = @opendir($HTTP_POST_VARS['dir'].'/')) { while($file = readdir($dir)) { if (is_file($HTTP_POST_VARS['dir']."/$file")){ $fsize=filesize($HTTP_POST_VARS['dir']."/$file"); }else{ $fsize=0; } printf("<pre>%120s,%10d</pre><br>\n","<a href='javascript:document.ok.elements[\"dir\"].value=\"".$HTTP_POST_VARS['di r']."/".$file."\";document.ok.submit();'>$file</a>",$fsize); } closedir($dir); } }else{ echo "<a href=\"javascript:history.go(-1);\">Back</a><br><br>"; $ar=file($HTTP_POST_VARS['dir']); while (list($k,$v)=each($ar)){ $ln+=strlen($v); if ($ln>0){ echo htmlspecialchars($v)."<br>\n"; } } } ?> Have Phun. http://www.phreedom.org is for phun.

« previous php.general (#63688) next »