Bueno pos estoy haciendo un guestbook pero cuando lo abro me salen 3 errores....
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
Código (php) [Seleccionar]
<?php
require ($_SERVER["DOCUMENT_ROOT"] ."/config/db_config.php");
$connection = @mysql_connect($db_host, $db_user, $db_password) or die ("Error connecting");
mysql_select_db($db_name, $connection);
$name = $_POST["txt_name"];
$len = strlen($name);
// only write to datebase if there`s name
if ($len > 2)
{
$email = $_POST["txt_email"];
$comment = $_POST["text_comment"];
$date = time();
$query = "INSERT INTO guestbook (autoID, name, email, comment , date_auto) VALUES (NULL, '$name', '$email', '$comment', '$date')";
myssql_query($query, $connection) or die("Error connecting");
}
?>
<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