Location: PHPKode > projects > MyFWB - Faisal Shah's dition > MyFWB/includes/editor_edit.php
<?php
session_start();
/*
MyFWB 1.0 Faisal Shah's édition 
23 August 2008 20:54 French standard time.
This is a free software made to be good for some one, and it comes as it is with no warrenty, and it's a copy righted Software which means you can use and distribute it to un-limited number of people but can't edit / re-produce or re-make any thing from it's core code, This software is free for ever and for everyone, but REMOVING COPYRIGHT FROM THE BOTTOM OF ANY PART OF IT MAKES IT ILLEGAL TO USE. IF YOU DO THIS, AND WE GOT THE REPORT, IT CAN CAUSE THE TERMINATION OF YOUR SITE AND SOME TIMES WE DO REPORT THESE KIND OF CASES TO YOUR ISP (INTERNET PROVIDER TO SHUT DOWN YOUR INTERNET CONNETION).. SO PLEASE KEEP IT LEGAL. Thanks for using our product!
(c)2008 Faisal Tasleem Shah All Rights Reserved.
*/

$sid = session_id();

if($_GET["action"] == "edit" && $_GET["pageid"] && $_GET["securekey"] == $sid)
{
$page_to_edit = $_GET["pageid"];

$connect = mysql_connect("$db_host","$db_user","$db_pass") or die("can't connect to DB");
mysql_select_db("$db_name") or die("can't select the DB");

$query_getting_page = mysql_query("select pageid, pagetitle, page_content from site where pageid=$page_to_edit");
$page_edit = mysql_fetch_array($query_getting_page);
if($page_edit == "")
{
echo "General Error : Invalid Page id...";
exit();
} ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>Editing an exiting page in MyFWB.</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="robots" content="noindex, nofollow">

	</head>
	<body>
		<h1>Editing an exiting page in MyFWB.</h1>
<?php  require_once("core_editor_edit.php"); ?>
	</body>
</html>
<?php
}elseif($_GET["action"] == edited && $_GET["sid"] == $sid)
{
$connect = mysql_connect("$db_host","$db_user","$db_pass") or die("can't connect to DB");
mysql_select_db("$db_name") or die("can't select the DB");
$pageid = $_POST["pageid"];
$pagetitle = secure("$_POST[pagetitle]");
$page_content = page_content("$_POST[page_content]");

$writing_back_info = mysql_query("UPDATE site SET pagetitle = '$pagetitle' , page_content = '$page_content' where pageid=$pageid;");
echo "Thanks, the page is updated.<br> You can go to main page of your Admin CP or you can go to <a href=\"?action=site_management&sid=$sid\">Site management</a>.<br> Thanks for using MyFWB."; 
exit();
}
?>
Return current item: MyFWB - Faisal Shah's dition