Hey all. I am trying to send a simple forum to the next page using post. I cannot get the variables on the second page to work. I keep getting an error on the post variables. let me show what I am talking about
Page 1
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="addnews.php" method="post" target="_self">
<input name=username type="text" value="Username" size="15" maxlength="15"><br>
<input name=title type="text" value="Enter Title" size="20" maxlength="20"><br>
<textarea name=message cols="75" rows="15"></textarea><br>
<input name=submit type="submit" value="Submit">
</form>
</body>
</html>
Addnews.php page
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include("mconnect.php");
if ($submit == "Submit"){
if(!mysql_query("INSERT INTO news (user, message, title) VALUE ('$username', '$message', '$title')")){
print 'Data could not be updated'. mysql_error();
}
else print 'News has been updated';
}
else include("postnews.asp");
?>
</body>
</html>
I have tried copying to the code from a book and i have the same problem. Why would i not be able to send items over POST? i am running iis with WindowsXP, the newest PHP from PHP.net and MySQL.
Thanks for any help.