HEX
Server: Apache
System: Linux iad1-shared-e1-19 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: austral3d (14892361)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /home/austral3d/fourdplan.com/pruebas/php/subir_noticia.php
<?php
$titulo = $_POST['titulo'];
$noticia = nl2br($_POST['noticia']);
date_default_timezone_set("America/Santiago");
$fecha = date("Y-m-d G:i:s");
require('conexion2.php');
if($titulo == null || $noticia == null){
	echo'<script>
	alert("Debe llenar todos los campos.")
	self.location="insertar_noticia.php"
	</script>';
}else{
	mysql_query("insert into noticias (id,titulo,noticia,fecha) values ('','$titulo','$noticia','$fecha')");
	echo'<script>	
	alert("Los datos han sido ingresados correctamente.")	
	self.location="insertar_noticia.php"	
	</script>';
}
?>