PHP - error if session de usuario

 
Vista:

error if session de usuario

Publicado por albert (21 intervenciones) el 14/09/2021 17:53:39
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
session_start();
?>
<?php
if (isset($_SESSION['user'])) {
echo'
<!doctype html>
<html>
<head>
<title>Cloud - Unlimited:<?php echo $_SESSION["user"];?></title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="./bootstrap/3.3.7/css/bootstrap.min.css" >
<!-- Optional theme -->
<link rel="stylesheet" href="./bootstrap/3.3.7/css/bootstrap-theme.min.css" >
<script src="./ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="./bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel='stylesheet prefetch' href='./ajax/libs/bootstrap-select/1.11.2/css/bootstrap-select.min.css'>
<style>
.navbar {
        position: relative;
        min-height: 50px;
        margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="container">
  <div class="row">
    <hr style="margin-top:5px;margin-bottom: 5px;">
    <div class="content"> </div>
    <div class="panel panel-primary">
      <div class="panel-heading">
        <h3 class="panel-title">Cargar Ficheros</h3>
      </div>
      <div class="panel-body">
        <div class="col-lg-6">
          <form method="POST" action="CargarFicheros.php" enctype="multipart/form-data">
<div class="form-group">
              <label class="btn btn-primary" for="my-file-selector">
                <input required="" type="file" name="file" id="exampleInputFile">
              </label>
</div>
          <button class="btn btn-primary" type="submit">Cargar Fichero</button>
          </form>
        </div>
        <div class="col-lg-6"> </div>
      </div>
    </div>
<!--tabla-->
    <div class="panel panel-primary">
      <div class="panel-heading">
        <h3 class="panel-title">Descargas Disponibles</h3>
      </div>
      <div class="panel-body">
<table class="table">
  <thead>
    <tr>
      <th width="7%">#</th>
      <th width="70%">Nombre del Archivo</th>
      <th width="10%">Descargar</th>
      <th width="10%">Eliminar</th>
    </tr>
  </thead>
  <tbody>
<?php
$archivos = scandir("subidas");
$num=0;
for ($i=2; $i<count($archivos); $i++)
{$num++;
?>
<p>
 </p>
    <tr>
      <th scope="row"><?php echo $num;?></th>
      <td><?php echo $archivos[$i]; ?></td>
      <td><a title="Descargar Archivo" href="../accounts/<?php echo $_SESSION["user"]; echo $archivos[$i]; ?>" download="<?php echo $archivos[$i]; ?>" style="color: bl>
      <td><a title="Eliminar Archivo" href="Eliminar.php?name=../accounts/.<?php echo $_SESSION["user"]; echo $archivos[$i]; ?>" style="color: red; font-size:18px;" on>
    </tr>
 <?php }?>
  </tbody>
</table>
</div>
</div>
<!-- Fin tabla-->
  </div>
</div>
</body>
</html>
';
}else{
header'../login.php';
 
}
 
?>







cual puede ser el error no comprueba la session de variable user y he iniciado sesion!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder