| Current Path : /var/www/cesa.co.za/Mailer/ |
| Current File : /var/www/cesa.co.za/Mailer/doUpdateArticle_old.php |
<?php
require_once ('includes/globals.php');
if (isset($_SESSION['database'])) {
if (isset($_SESSION['userid'])) {
$userid = $_SESSION['userid'];
} else {
echo "<script>document.location.href='index.php';</script>\n";
}
$h_sectionid = $_POST['parentid'];
$h_title = str_replace('"', '"', str_replace("'", '´', $_POST['title']));
$h_copy = str_replace('"', '"', str_replace("'", '´', $_POST['theBody']));
$h_image = 'n/a';
$h_url = $_POST['link'];
$h_linktitle = str_replace('"', '"', str_replace("'", '´', $_POST['linkText']));
if(is_uploaded_file($_FILES['image']['tmp_name'])) {
$h_image = $_FILES['image']['name'];
//echo $_FILES['image']['tmp_name'];
move_uploaded_file($_FILES['image']['tmp_name'], $local_image_folder . $_FILES['image']['name']);
}
//echo $sql_addnewsletter;
$db = $_SESSION['database'];
$sql = "UPDATE Headlines\n" .
"SET sTitle = '" .$h_title . "', txtCopy = '".$h_copy .
"', sImage = '".$h_image . "', sUrl = '".$h_url . "', sLinkTitle = '".$h_linktitle . "'\n" .
"where idHeadline = " . $_POST['updateid'];
//echo $sql;
if ($db->Execute($sql) === false) {
die("Could not modify article");
} else {
?>
<script language="JavaScript" type="text/javascript">
//window.close();
window.location = "manageNewsletter.php?id=<?php echo intval($_POST['t']); ?>&pid=<?php echo intval($_POST['s']); ?>";
</script>
<?php
}
}
?>