I am having troubles with this script.. its a script that uses a form to add news to the news page.. i also found someones code for dynamic includes (www.yourcom.com/index.php?page=pagex) and im using that and its including my pages into the body.. but i dont know if you needed to know that well heres my code then ill tell you what happens...
[code=php]
<?
function OpenNews() {
echo "<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"18\">
<tr>
<td background=\"images/newsbg1.gif\" width=\"498\" height=\"30\"> <b> $time Posted By: <a href=\"mailto:$email\">$poster</a> <a href=\"?id=25\">Add New Post</a></b> </td>
</tr>
<tr>
<td background=\"images/newsbg2.gif\" width=\"498\" height=\"14\">
<!----->
<center><span id=\"News\">";
}
function CloseNews() {
echo "</span></center>
<!----->
</td>
</tr>
<tr>
<td width=\"498\" valign=\"top\" background=\"images/newsbg3.gif\" height=\"1\">
</td>
</tr>
</table>";
}
$time = date("F jS Y, h:iA");
$form = "
<form method=\"post\" action=\"AddNews.php\">
Your Name: <input type=\"text\" name=\"poster\" size=20><br>
Your Email: <input type=\"text\" name=\"email\" size=20><br>
Your News:<br><textarea name=\"message\" cols=30 rows=5 wrap=virtual></textarea><br>
<input type=\"hidden\" name=\"op\" value=\"ds\">
<input type=\"submit\" name=\"submit\" value=\"add news\">
</form>
";
if ($op != "ds") {
echo "$form";
}
else if ($op == "ds") {
if ($poster == "") {
$name_err = "<font color=red>Please enter your name...</font>";
$add = "no";
}
if ($message == "") {
$news_err = "<font color=red>Please enter your news...</font>";
$add = "no";
}
if ($email == "") {
$email_err = "<font color=red>Please enter your email...</font>";
$add = "no";
}
if ($add != "no") {
$fp = fopen("Includes/news.php", "w");
fputs(OpenNews() . "$message" . CloseNews(), $fp);
fclose($fp);
} else if ($add == "no") {
echo "$name_err";
echo "$email_err";
echo "$news_err";
echo "$form";
}
}
?>
[/CODE]
when i submit it whethere i filled it out or not it jus puts me back at index.php not changing anything... no error messages or anything... I am new to php so im not really sure whats wrong... and i know its pretty sloppy code this file is AddNews.php.... i dont know if it could be something with the ?page=page thing since it goes back to index.php on submit...