Código :
<?php include("BD.php"); if(isset($_POST['name'])) { // name, mail, ip, comment, date (deluxebox) $name =$_POST['name']; $mail =$_POST['mail']; $ip =$_SERVER["REMOTE_ADDR"]; $comment = $_POST['comment']; $date = date('F j Y'); mysql_query('INSERT INTO deluxebox_book (name, mail, ip, comment, date) VALUES ("' . $name . '", "' . $mail . '", "' . $ip . '", "' . $comment . '", "' . $date . '");') or $error = true; if(isset($error)) echo 'Ha ocurrido un error al crear los datos!<br><small>' . mysql_error() . '</small>'; else header("Location:index.php"); exit; } echo'<form action="'. $PHP_SELF .'" method="POST"> <p>*Nombre:</p> <input type="text" name="name" id="name"><br> <p>*Email(no sera expuesto):</p> <input type="text" name="mail" id="mail"><br> <p>Comentario</p> <textarea name="comment" id="comment"></textarea><br> <input type="Submit" value="Enviar">'; ?>
El cual intento redireccionar hacia la pagina "index.php", no se por que pero el Php me muestra esto:
Warning: Cannot modify header information - headers already sent by (output started at http://localhost/comment.php/Vers/comment.php:6) in C:\AppServ\www\GestBook\comment.php on line 121
Bueno, la idea es que me redireccione hacia index.php luego de terminar con el form.
Gracias espero que me puedan ayudar.
