<html>
<form action="" method="Get">
<select name="id">
<option value="noneselected" selected="ns">None Selected</option>
<option value="index">Index</option>
<option value="register">Register</option>
</select>
<input type="submit" value="Edit" />
</form>
</html>
<?php
include("system/templates/Template_editor.php");
$id = $_GET['id'];
$template->edit_templates($id);
$template->update_templates($id);
?>
<?php
class Template
{
function get_templates()
{
}
function edit_templates($id)
{
$filename = $id;
if ($filename != ''
{
$fh = fopen("view/templates/" . $filename . ".php", "r") or die("Could not open the template!");
$data = fread($fh, filesize("view/templates/" . $filename . ".php")) or die("Could not read the template");
fclose($fh);
echo "<center><form action='$_SERVER[php_self]' method= 'post' ><textarea name='update' cols='150%' rows='20'>$data</textarea>
<input name='id' type='hidden' value='" .$filename. "'/><input type='submit' value='Change'></form></center>";
$this->update_templates($filename);
}
}
function update_templates($id)
{
$newdata = $_POST['update'];
$filename = $_POST['id'];
if ($filename != ''
{
$fw = fopen("view/templates/" . $filename . ".php", 'w'
or die('Could not open the template!'
;
$fb = fwrite($fw, stripslashes($newdata)) or die('Could not update your template'
;
fclose($fw);
?>
<META HTTP-EQUIV=Refresh CONTENT="1">
<?php
}
}
}
$template = new Template;
?>
Copyright © 2026, NextGenUpdate.
All Rights Reserved.