Location: PHPKode > projects > EZphotopress > ezphotopress-1.0.0/admin/pages/modifyPage.php
<h3><?=MODIFYPAGE_TITLE?></h3>
<br>
<?php
if (isset($_POST['action']) && $_POST['action'] == MODIFYPAGE_FORM_SUBMIT) {
	$title = $_POST['title'];
	$body = $_POST['body'];
	$code = $_POST['code_page'];
	
	$query = "update ".TABPREFIX."pages set ";
	$query .= "code='".addslashes($code)."',";
	$query .= "title='".addslashes($title)."',";
	$query .= "body='".addslashes($body)."',";
	$query .= "last_modify=NOW() where id=".$paid;
			
	$result = $db->query($query);
	if ($result->sizeIDU() != -1) {
		?>
		<p class="ok">
			<?=MODIFYPAGE_MESSAGE_SUCCESS?>
		</p>
		<br>
		<center>
			<a href="home.php?id=pages&action=manage" class="back"><?=MODIFYPAGE_LINK_CONTINUE?></a>
		</center>
		<?php
	} else {
		?>				
		<p class="ok">
			<?=MODIFYPAGE_MESSAGE_ERROR?>
		</p>
		<br>
		<center>
			<a href="home.php?id=pages&action=manage" class="back"><?=MODIFYPAGE_LINK_CONTINUE?></a>
		</center>
		<?php
	}
} else {
	$query = $db->query("select * from ".TABPREFIX."pages where code='about_me'");
	$row = $query->fetch();
	?>
	<script type="text/javascript">
		function changeTest(form) { 
			var s = document.getElementById('title').value;
			//replace all special chars
			s = s.replace(/[^0-9a-zA-Z]+/g, "_");
			document.getElementById('code_page').value = s.toLowerCase();
		} 
	</script>
	<form action="home.php?id=page&action=manage&paid=<?=$row['id']?>" method="post" name="form_page" id="form_page">
		<input type="hidden" id="idpage" name="idpage" value="<?=$row['id']?>">
		<fieldset>
			<div>
				<label><?=MODIFYPAGE_FORM_TITLE?></label>
				<input type="text" id="title" name="title"  size="50" onkeyup="changeTest(this.form_page)" value="<?=$row['title']?>">
			</div>
			<div>
				<label><?=MODIFYPAGE_FORM_ID?></label>
				<input type="text" id="code_page" name="code_page"  size="50" value="<?=stripslashes($row['code'])?>" readonly="readonly">
			</div>
			<div>
				<label><?=MODIFYPAGE_FORM_BODY?></label>
				<textarea rows="15" class="tinymce" name="body"><?=stripslashes($row['body'])?></textarea>
			</div>
			<div style="text-align: center;">
				<input type="submit" name="action" value="<?=MODIFYPAGE_FORM_SUBMIT?>">
			</div>
		</fieldset>
	</form>
	<br>
	<center>
		<a href="javascript:history.back()" class="back"><?=MODIFYPAGE_LINK_BACK?></a>
	</center>
	<?php 
}
?>
Return current item: EZphotopress