So, here is the code I have now, and it doesn't give any errors, but it doesn't write anything to the specified file either...let me know what I need to change, thanks.
up-budget-2.php:
<?php
require("db_functions.php");
require("design_functions.php");
require("utility_functions.php");
##check_employee("normal");
$employee = get_employee_name();
$server_path_to_feature_fronts = "/webroot/budget/";
$errors = "";
contact the database and stuff in the new, eh....stuff
if($errors == "") {
db_connect();
### First update the table that holds all the information
$sql = "insert into stories
(pubdate,pub,section,page,series,keywords,headline,byline,intro,bodytext,photocredit,caption,custom5,custom4)
values('$pubdate','$pub','$section','$page','$series','$keywords','$headline','$byline','$intro','$bodytext','$photocredit','$caption','$custom5','$custom4')";
$fp = fopen('file.html','a+');
if($fp)
{
fwrite($fp,$data);
}
else
{
die('Could not open file.');
}
if($result = mysql_query($sql)) {
$fulfilled .= "<li>Updated the database with the new story";
} else {
$errors .= "<p><li>Failed updating the database (<strong>database might be down, call Trentimus Maximus!</strong>)";
}
db_close();
} else {
$errors .= "<p><li>Didn't update the database (<strong>missing files - start over!</strong>)";
write_log("$employee <font color=red>failed</font> to upload a featurefront");
}
Print out a report of what's been done (and what failed)
if($errors != "") {
complaint($errors);
} else {
Header("Location: /addtool.php");
}
?>