![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
05/01/2010, 14:13
|
| | Fecha de Ingreso: mayo-2008 Ubicación: Chihuahua
Mensajes: 30
Antigüedad: 16 años, 9 meses Puntos: 1 | |
Respuesta: Sistema de comentarios PHP Si tengo el password bien :]
<?php
$username = "tiemp";
$password = "*******";
$hostname = "localhost";
$dbname = "tiemp_pclaudia";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Tiempo La noticia digital</title>
</head>
<body>
<?php
if(isset($_POST["id"])
&& isset($_POST["nick"]) && isset($_POST["comentario"]))
{
if(!empty($_POST["comentario"]))
{
if($_POST["nick"] == "")
{
$nickNuevo = "anonimo";
}
else
{
$nickNuevo = $_POST["nick"];
}
$idNoticia = $_POST["id_n"];
$comentarioNoticia = $_POST["comentario"];
mysql_query("INSERT INTO comentarios (id_noticia,nick,comentario) VALUES ('$idNoticia','$nickNuevo','$comentarioNoticia')") ;
echo "Comentario Enviado Con Exito.<BR>Espere Unos Segundos...<SCRIPT LANGUAGE=\"javascript\">window.location.href = \"".getenv('HTTP_REFERER')."\";</SCRIPT>";
}
else
{
echo "Debe Introducir Un Comentario.";
}
}
?>
</body>
</html> |