<?
}
else
{
// includes
include("conf.php");
// set up error list array
$errorList = array();
$count = 0;
// validate text input fields
if (!$headline) { $errorList[$count] = "Invalid entry: Headline"; $count++; }
// check for errors
// if none found...
if (sizeof($errorList) == 0)
{
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "INSERT INTO news(date, headline, story, external, url) VALUES('$date', '$headline', '$story', 1, '$url')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// print result
echo "<font class='text_main'>Story successfully added to the database.<br><br><b>- <a href='index.php' class='text_main_link'>Go back to the control panel menu</a>.<br>- <a href='recruit_add.php' class='text_main_link'>Add another prospect to the database</a>.</font>";
// close database connection
mysql_close($connection);
}
else
{
// errors found
// print as list
echo "<font size=-1>The following errors were encountered: <br>";
echo "<ul>";
for ($x=0; $x<sizeof($errorList); $x++)
{
echo "<li>$errorList[$x]";
}
echo "</ul></font>";
}
}
?>
I had it on another server and this worked, but on my new server this won't work, any ideas (client side or server side)...
When you enter the information and click the Add button it basically refreshes the page without adding the content.