[SOLVED]Deleate the extention while reading a directory?
Posted: Fri Jan 09, 2004 11:39 pm
Hello, I am trying to read a directory but i want it to deleate the extention zip and replace it with .rwx, Now I can make it put .rwx on it with out replacing it. Is it possible to make this put the directorys files to .rwx? or jsut deleate teh externtions all together? heres teh code:
And is there a way to read the fils in a directory if its not on your server? Thanks
Code: Select all
<?php
if( $user == "(Deleated)" && $pass == "(Deleated)" ) {
$dirname = "./";
$dh = opendir($dirname) or die("Can't Open:" . $dirname);
while ($file = readdir($dh)) {
if(is_file($dirname.$file)) {
echo "$file<br />";
} else {
Print "Sorry, There has been an error.";
}
}
closedir($dh);
} Else { ?>
<html>
<head>
<title>Sign In</title>
</head>
<body bgcolor="#FFFFFF">
<form action="<?php $PHP_SELF ?>" method="post" name="form">
<table cellpadding="0" cellspacing="0" width="225"align="center" style="border-top: #000000 1px solid; border-right: #000000 1px solid; border-bottom: #000000 1px solid; border-left: #000000 1px solid;">
<tr>
<th>Sign In</th>
</tr>
<tr>
<td>
<table cellpadding="5" cellspacing="0" border="0" width="225" align="center" style="border-top: #000000 1px solid;">
<tr>
<td width="100"> <b>Username</b>:</td>
<td width="175"><input type="text" name="user" style="border-top: #000000 1px solid; border-right: #000000 1px solid; border-bottom: #000000 1px solid; border-left: #000000 1px solid; background: #FFFFFF; color: #000000;" /></td>
</tr>
<tr>
<td width="100"> <b>Password</b>:</td>
<td width="175"><input type="password" name="pass" style="border-top: #000000 1px solid; border-right: #000000 1px solid; border-bottom: #000000 1px solid; border-left: #000000 1px solid; background: #FFFFFF; color: #000000;" /></td>
</tr>
<tr>
<th width="225" colspan="2"><input type="submit" name="submit" value="Enter" style="border-top: #FFFFFF 1px solid; border-right: #FFFFFF 1px solid; border-bottom: #FFFFFF 1px solid; border-left: #FFFFFF 1px solid; background: #FFFFFF; color: #000000;" /></th>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<?php }
?>And is there a way to read the fils in a directory if its not on your server? Thanks