Hola a todos como estan. Arme en PHP un formulario donde te pide algunos datos de para agregar a una base de datos... el problema q a la hora de agregar me tira un error:
Not Acceptable
An appropriate representation of the requested resource /admin/app.php could not be found on this server.
y la verdad me esta volviendo loco.... a ver si me pueden ayudar. Gracias....
Código:
<?
error_reporting(E_ERROR | E_WARNING | E_PARSE);
define('CONST', TRUE);
$dir="../";
session_start();
require_once("config.php");
require_once("funciones.php");
require_once("constantes.php");
$db = new SQL($dbhost, $dbname, $dbuser, $dbpass);
if($_SESSION['Tipo']!=1){header('Location: index.php');}
if($_GET['inc']=="logout"){
session_destroy();
header('Location: index.php');
}
if($_GET['inc']=="del"){
$sql = "DELETE FROM " . TABLA_APP . " WHERE id='" . $_GET['id'] . "'";
$db->query($sql);
$mensaje = "ELIMINADO CORRECTAMENTE";
}
?>
<html>
<head>
<title>Admin Descarga Directa</title>
<link href="../img/StyleSheet.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Estilo5 {color: black}
-->
</style>
</head>
<body>
<div align="center">
<?
$sql = "INSERT INTO ". TABLA_APP . " (titulo,img,urldd,clave,descripcion) VALUES ('" . $_POST['titulo'] . "','" . $_POST['img'] . "','" . my_clean($_POST['urldd']) . "','" . $_POST['clave'] . "','" . $_POST['descripcion'] . "')";
if(!empty($_POST['agregar'])){
if(!empty($_POST['titulo']) && !empty($_POST['img']) && !empty($_POST['urldd'])){
if($db->query($sql)){$mensaje = "AGREGADO CORRECTAMENTE";}else{$mensaje = "ERROR";}
}else{$mensaje = "DEBE COMPLETAR TODOS LOS DATOS.";}
}
?>
<a href="app.php?inc=logout" class="Estilo4"></a><a href="app.php?inc=logout" class="Estilo4">LOGOUT</a><br><br>
</div>
<center><div style="background-color:#CCCCCC; padding:10px; width:500px; text-align:justify;" align="">
<h2>Nueva Aplicacion </h2>
<form name="" method="post" action="">
<table width="450" border="0" align="center" style="padding:6PX; ">
<tr>
<td><div align="center" class="Estilo1">Titulo:</div></td>
<td class="Estilo1">
<input name="titulo" type="text" id="titulo" size="40">
(*) </td>
</tr>
<tr>
<td width="138"><div align="center" class="Estilo1">Imagen: </div></td>
<td width="302" class="Estilo1">
<input name="img" type="text" id="img" value="http://" size="40">
(*) </td>
</tr>
<tr>
<td><div align="center" class="Estilo1">URL DD:</div></td>
<td class="Estilo1">
<input name="urldd" type="text" id="urldd" size="40">
(*) </td>
</tr>
<tr>
<td><div align="center" class="Estilo1">Clave: </div></td>
<td class="Estilo1">
<input name="clave" type="text" id="clave" size="40"> </td>
</tr>
<tr>
<td><div align="center">
<p class="Estilo1">Descripcion: </p>
</div></td>
<td class="Estilo1">
<textarea name="descripcion" cols="40" id="descripcion">
</textarea> </td>
</tr>
<tr>
<td colspan="2" class="Estilo1"><div align="center">
<input name="agregar" type="submit" class="Estilo1" id="agregar" value="Agregar">
</div></td>
</tr>
<tr>
<td colspan="2" class="Estilo1"><div align="center" class="Estilo5"><? if(!empty($mensaje)){echo $mensaje;} ?><br>
</div></td>
</tr>
</table>
</form>
<p></p>
</div>
<span class="adsense Estilo5">-</span>
<div style="background-color:#CCCCCC; padding:10px; width:500px; text-align:justify;" align="">
<h2>Listado de App</h2>
<?
$sql = "SELECT * FROM " . TABLA_APP . " ORDER BY ID DESC";
$tot = $db->fetchAll($sql);
if(count($tot)>0){
foreach($tot as $doc){?>
<span class="Estilo4"><?echo $doc['titulo']?>
- <a class="linknon" href="app.php?inc=del&id=<?=$doc['id']?>" onClick="return confirm('Esta seguro de que desea ELIMINARLA?')">Eliminar esta APP</a><br>
<?
}}
?>
</span></div>
</center>
</body>
</html>