Jump to content

ajuda em gestor de ficheiro


wrproject
 Share

Recommended Posts

boas,tenho este codigo

<?php
ob_start();
session_start();
$_SESSION['dir'];
//autenticar o utilizador

if(!isset($_SESSION['user']))
{
header("location: login.php");
}
?>
<?php
include "conecta.php";
?>
<?php

//mudar para o directorio Projectos

if(!isset($_GET['directorio']))
{
chdir("Projectos");
}
else
{
chdir("testes");
}
$path=getcwd();
$dir=dir($path);
?>
<html>
<body>
<table border=1 width="810" align="center">
<tr>
<td>
<b>Ficheiro</b>
</td>
<td>
<b>Data Criação</b>
</td>
<td>
<b>Criado por</b>
</td>
<td>
<b>Notas</b>
</td>
</tr>
<?php
while(($file=$dir->read())!==false)
{
if($file !=".." && $file!=".")
{
?>
<tr>
<td>
<?php 
if(is_dir($file))
{
//$fullpath=realpath($file);
echo "<a href=?directorio={$file}><img src='imagens/pasta.bmp' border=0 /></a>".$file;
}
else if(is_file($file))
{
echo "<img src='imagens/ficheiro.bmp'></img>".$file;
}
?>
</td>
<td>
<?php
echo date("d/m/Y H:i:s.",filemtime($file));
?>
</td>
<td>sdsd</td>
<td>sdsd</td>
</tr>
<?php
}
}
$dir->close();
?>
</table>
</body>
</html>

o que se passa e o seguinte,como faco para criar uma variavel que nao e destruida ao fim do script,podendo assim manter o caminho do directorio actual,para poder entrar em outro?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.