Hi,
i'm trying to set up a form to write info to a database in mysql and i'm getting the error message below. i was talking to someone in the newbies forum who suggested i post my question here because the code is supposedly ok and it may be something to do w/ my configuration of php. does anyone have any suggestions?
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
(the error log generates the following error:
[Sat Jan 03 02:52:13 2004] [error] [client 127.0.0.1] Premature end of script headers: c:/apache/php/php.exe
)
<body>
<?php
if ($submit){
// process form
$db = mysql_connect("localhost", "root", "");
mysql_select_db("test2", $db);
$sql = "INSERT INTO message (message) values ('$message')";
$result = mysql_query($sql) or die("An error occured when inserting:" .mysql_error());
if ($result)
{
echo "Thank You! Information entered. <br>";
}
}
else {
?>
<form method="post" action="lastime.php">
<textarea rows=10 cols=30 name="message">
Please write your message here
</textarea> <br>
<input type="submit" name="submit" value="submit">
</form>
<?
}//end else
?>
</body>
</html>