Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/11/2007, 16:27
gesking
 
Fecha de Ingreso: diciembre-2006
Mensajes: 294
Antigüedad: 17 años, 5 meses
Puntos: 2
Insertar info a BD

Hola que hago mal????

Código PHP:
<div align="center">
  <p><img src="imagenes/logo.jpg"></p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</div>
<?
include("config.php");
if(
admin()){ 
?>
<form method="post" action="noticia.php">
<table border="0" cellpadding="2" cellspacing="1" align="center">
 <tr>
  <td valign="top" width="14%"><br>Anuncio:</td>
  <td><TEXTAREA name="noticialarga" style="width: 420" rows="9" id="texto" onfocus="elEditor = ini_editor(this)" onchange="prever()"></TEXTAREA></td>
 </tr>
 <tr></tr></table>
 <tr>
  <td>&nbsp;</td>
  <td><input type="submit" name="enviar" value="Enviar">&nbsp;&nbsp;<input type="reset" name="restablecer" value="Restablecer"></td>
 </tr>
</table>
</form>
<?
$anuncio 
quitar($_POST[anuncio]);

if(!
$anuncio){
echo 
'Faltó completar un campo obligatorio<br>
<a href="noticia.php">Volver</a>'
;
} else {

$sql "INSERT INTO host-image(anuncio, activo) values('$anuncio', '1')";
$res mysql_query($sql) or die("Error: ".mysql_error());

echo 
'Noticia Ingresada con éxito <br>
<a href="noticia.php">Volver</a><br>
<a href="menu.php">Volver al index</a>'
;
}
} else {
echo
"Esta seccion es solo para administradores !";
}
?>
Gracias