This is add_news.php , when i click SUBMIT button, the warning out like this:
The page you are looking for cannot be displayed because the page address is incorrect.
<?php
include("config.php");
if ( isset ($submit))
{
// Set global variables to easier names
$id = $POST['id'];
....
$zone = $POST['zone'];
//check if (libName) field is empty then print error message.
if(!$libName){ //this means If the title is really empty.
echo "Error: Required field. Please fill it.";
exit();
}
//check if (libCode) field is empty then print error message.
if(!$libCode){
echo "Error: Required field. Please fill it.";
exit();
}
//run the query which adds the data gathered from the form into the database
$result = mysql_query("INSERT INTO myLibrary (libName, dTime, libCode, libCat, address, postcode, district, dun, par, phone,
email, web, empName, empPost, idTime, zone )
VALUES ('$libName',NOW (), '$libCode', '$libCat', '$address', '$postcode', '$district', '$dun',
'$par, '$phone', '$email', '$web', '$empName', '$empPost', '$idTime', '$zone')",$connect);
//print success message.
echo "<b>Thank you! New info added Successfully!<br>You'll be redirected to Home Page after (4) Seconds";
echo "<meta http-equiv=Refresh content=4;url=index.php>";
}
// If the form has not been submitted, display it!
else
{
?>
<br>
<h3>::Add News</h3>
<form method="post" action="<?php echo $PHP_SELF ?>">
<table width="684" border="0" bordercolor="#003399" bgcolor="#99CCFF">
<tr>
</tr>
<tr>
<td height="28" ><span class="style56">
<input type="submit" name="submit" value="Add News">
</span></td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<?
}
?>
This is index.php:
<title>News----By: maaking.com</title>
<?php
// load the configuration file.
include("config.php");
//load all news from the database and then OREDER them by newsid
//you will notice that newlly added news will appeare first.
//also you can OREDER by (dtime) instaed of (news id)
$result = mysql_query("SELECT * FROM myLibrary ORDER BY id ASC",$connect);
//lets make a loop and get all news from the database
while($myrow = mysql_fetch_array($result))
{//begin of loop
//now print the results:
echo "<b>Library Name : ";
echo $myrow['libName'];
echo "</b><br>Add/Modify On : <i>";
echo $myrow['dtime'];
echo "</i><hr align=left width=160>";
echo "<b>Category : ";
echo $myrow['libCat'];
// Now print the options to (Read,Edit & Delete the news)
echo "<br><a href=\"read_more.php?id=$myrow[id]\">Read More...</a>
|| <a href=\"edit_news.php?id=$myrow[id]\">Edit</a>
|| <a href=\"delete_news.php?id=$myrow[id]\">Delete</a><br><hr>";
}//end of loop
?>
<!-- here you have the right to go Home or Add News. It's HTML not PHP -->
<br><br>
<a href=index.php>Home</a> <a href=add_news.php>Add News</a>
-->Help Me Plz