Código
<?php require ($_SERVER["DOCUMENT_ROOT"] ."/config/db_config.php"); $name = $_POST["txt_name"]; // only write to datebase if there`s name if ($len > 2) { $email = $_POST["txt_email"]; $comment = $_POST["text_comment"]; $query = "INSERT INTO guestbook (autoID, name, email, comment , date_auto) VALUES (NULL, '$name', '$email', '$comment', '$date')"; } ?> <html> <head> <title>GuestBook</title> </head> <body> <center> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <font face="verdana" size="1"> Name: <input type="text" name="txt_name"> <br> Email: <input type="text" name="txt_email"> <br> Comment: <br><textarea style="width: 40%" rows="10" name="text_comment"></textarea> <center><input type="submit" value="Send Comment"></center> </font> </form> </center> </body> </html>
el 1º es
"Notice: Undefined index: txt_name in J:\webserver\guestbook.php on line 6"
ahi no veo ningun error es el $name = $_POST["txt_name"]; pero no hay nada (segun mi que sea error)
el segundo es que me manda esto cuando doy a submit (ya esta solucionado)
Not Found
The requested URL /<br /><b>Notice</b>: Use of undefined constant PHP_SELF - assumed 'PHP_SELF' in <b>J:\webserver\guestbook.php</b> on line <b>25</b><br />/guestbook.php was not found on this server.
y el tercero es que me dice:
Fatal error: Call to undefined function myssql_query() in J:\webserver\guestbook.php on line 16
tampoco le veo el error...una mano pls....
Saludos