Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/ada/
Upload File :
Current File : /var/www/html/mmishra/mm/ada/pageedit.php

<?php
checkadmin($role);
$tbl = 'webpages';

$id = $_REQUEST["id"];
$mode = $_REQUEST["mode"];
$title = $_POST["title"];
$content = str_replace('"',"'",$_POST["content"]);
$txtKey = $_POST["keywords"];
$submit = $_POST["submit"];

if ($submit == "SAVE") {
	if (mysql_num_rows(mysql_query("select * from $tbl where id='$id'"))) {
		mysql_query("update $tbl set title='$title',content=\"$content\",
		keywords='$keywords' where id='$id'");
	} else {
		mysql_query("insert into $tbl values
		('$id','$title','Static','Public',\"$content\",'$keywords',now())");
	}
}

$o = mysql_fetch_object(mysql_query("select * from $tbl where id='$id'"));
echo $o->content;
?>
<br>
<a name="ed"></a>
<b>Edit content</b><br>
<input type='hidden' name='mode' value='edit'>
Page Title<br><input size='60' type='text' name='title' value='<?=htmlsafe($o->title)?>' class='input'>
<br>
Content<br><textarea name='content' class='input' cols='70' rows='10'><?=$o->content?></textarea>
<br>
Keywords<br><input size='60' type='text' name='keywords' value='<?=htmlsafe($o->keywords)?>' class='input'>
<input type='submit' name='submit' value='SAVE' style='width:80px'>
<input type='hidden' name='id' value='<?=$id?>'>