as I do to download and to show on screen a previously loaded image to the database
This is the php that seeks to load the image I do with the variable but the only thing that loads is the name of the image
<?php
include('is_logged.php');//Archivo verifica que
el usario que intenta acceder a la URL esta logueado
/* Connect To Database*/
require_once ("../config/db.php");//Contiene las variables de
configuracion para conectar a la base de datos
require_once ("../config/conexion.php");//Contiene funcion que
conecta a la base de datos
$action = (isset($_REQUEST['action'])&& $_REQUEST['action']
!=NULL)?$_REQUEST['action']:'';
if (isset($_GET['Nticket'])){
$incidencia=intval($_GET['Nticket']);
$query=mysqli_query($con, "select * from ticket where
Nticket='".$Nticket."'");
$rw_user=mysqli_fetch_array($query);
$count=$rw_ticket['Nticket'];
if ($Nticket!=1){
if ($delete1=mysqli_query($con,"DELETE FROM ticket WHERE Nticket='".$Nticket."'")){
?>
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>Aviso!</strong> Datos eliminados exitosamente.
</div>
<?php
}else {
?>
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>Error!</strong> Lo siento algo ha salido mal intenta nuevamente.
</div>
<?php
}
} else {
?>
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<strong>Error!</strong> No se pudo eliminar ésta categoría. Existen productos vinculados a ésta categoría.
</div>
<?php
}
}
if($action == 'ajax'){
// escaping, additionally removing everything that could be
(html/javascript-) code
$q = mysqli_real_escape_string($con,(strip_tags($_REQUEST['q'],
ENT_QUOTES)));
$aColumns = array('Nticket');//Columnas de busqueda
$sTable = "ticket";
$sWhere = "";
if ( $_GET['q'] != "" )
{
$sWhere = "WHERE (";
for ( $i=0 ; $i<count($aColumns) ; $i++ )
{
$sWhere .= $aColumns[$i]." LIKE '%".$q."%' OR ";
}
$sWhere = substr_replace( $sWhere, "", -3 );
$sWhere .= ')';
}
$sWhere.=" order by Nticket";
include 'pagination.php'; //include pagination file
//pagination variables
$page = (isset($_REQUEST['page']) && !empty($_REQUEST['page']))?$_REQUEST['page']:1;
$per_page = 10; //how much records you want to show
$adjacents = 4; //gap between pages after number of adjacents
$offset = ($page - 1) * $per_page;
//Count the total number of row in your table*/
$count_query = mysqli_query($con, "SELECT count(*) AS numrows FROM $sTable $sWhere");
$row= mysqli_fetch_array($count_query);
$numrows = $row['numrows'];
$total_pages = ceil($numrows/$per_page);
$reload = './clientes.php';
//main query to fetch the data
$sql="SELECT * FROM $sTable $sWhere LIMIT $offset,$per_page";
$query = mysqli_query($con, $sql);
//loop through fetched data
if ($numrows>0){
?>
<div class="table-responsive">
<table class="table">
<tr class="danger">
<th>ticket</th>
<th>Incidencia</th>
<th>Tema</th>
<th>Detalle</th>
</tr>
<?php
$nums=0;
while ($row=mysqli_fetch_array($query)){
$Nticket=$row['Nticket'];
$incidencia=$row['incidencia'];
$tema=$row['tema'];
$detalle=$row['detalle'];
$_FILES['imagen']['name']=$row['imagen'];
$nums++;
?>
<input type="hidden" value="<?php echo $row['Nticket'];?>" id="Nticket<?php echo $Nticket;?>">
<input type="hidden" value="<?php echo $row['incidencia'];?>" id="incidencia<?php echo $incidencia;?>">
<input type="hidden" value="<?php echo $row['tema'];?>" id="tema<?php echo $tema;?>">
<input type="hidden" value="<?php echo $row['detalle'];?>" id="detalle<?php echo $detalle;?>">
<input type="hidden" value="<?php echo $row['imagen'];?>" id="imagen<?php echo $_FILES['imagen']['name'];?>">
<tr>
<td><?php echo $Nticket; ?></td>
<td><?php echo $incidencia; ?></td>
<td><?php echo $tema; ?></td>
<td><a data-toggle="modal" href="#myModal_<?php echo $nums; ?>"><li
class='glyphicon glyphicon-info-sign'></li></a>
<div class="modal fade" id="myModal_<?php echo $nums; ?>" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×
</button>
<h4 class="modal-title">Detalle de la incidencia</h4>
</div>
<div class="modal-body">
<p><?php echo $detalle;?></p>
<p><?php echo $_FILES['imagen']['name'];?></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
test