Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/Mailer/
Upload File :
Current File : /var/www/cesa.co.za/Mailer/doUpdateNewsletter_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";
		}
		
		$sql = "UPDATE Newsletter\n" .
			"SET sTitle = '" . str_replace("'", '&acute;', $_POST['title']) . "', sHeading= '" . str_replace("'", '&acute;', $_POST['heading']). "', txtNotes = '" . str_replace("'", '&acute;', $_POST['notes']);
			if(intval($_POST['previousIssueID']) > 0) {			
				$sql .= "', idPreviousIssue=" . $_POST['previousIssueID'] . "\n";
			} else {
				$sql .= "'\n";
			}
			$sql .= "where idNewsletter = " . $_POST['updateid'];
		
		//echo $sql;
		$db = $_SESSION['database'];
		if ($db->Execute($sql) === false) {
			die("Could not update newsletter");
		} else {
		?>
		<script language="JavaScript" type="text/javascript">
			//window.close();
			window.location = "doLogin.php";
		</script>
		<?php
		}
	} 
?>