<?php

session_start();

include "../config.php";
include "../header.php";
include "../style.php";
if( isset($_SESSION["alogin"]) ) {

$index = dbput($_POST['index']);
$htmlcode = dbput($_POST['htmlcode']);

    	?><table>
      	<tr>
        <td width="15%" valign=top><br>
        <? include("adminnavigation.php"); ?>
        </td>
        <td valign="top" align="center"><br><br> <?
    echo "<font size=2 face='$fonttype' color='$fontcolour'><p><b><center>";


    $query = "update pages set htmlcode='".$htmlcode."' where id=".$index;
	$result = mysql_query ($query)
	     or die ("Update failed");

    echo "<center>Page has been updated!</center>";
    ?><p>Click <a href=editpages.php>here</a> to go back<p>
    </td>
    </tr>
    </table>
	<?
echo '<head>
<META HTTP-EQUIV="Refresh"CONTENT="1; URL=editpages.php">
</head>';
  	}

else  {
	echo "Unauthorised Access!";
    }
include "../footer.php";
mysql_close($dblink);
?>