CGI script for html content management
CGI script for html content management
(OP)
Hi all, first time poster. I have a problem that I am hoping can be solved here.
I work for a company that designs websites. I have finished one site, and after I finished it, my supervisor told me that the client we designed the site for, would like to have the ability to edit the site content. She said there was a CGI script that she used to use that allowed clients to edit text of thier pages without affecting the html code for the page, but she can't remember what it was or where she got it from(go figure). I need a CGI script that can do this. Can anybody help me out with this?
I work for a company that designs websites. I have finished one site, and after I finished it, my supervisor told me that the client we designed the site for, would like to have the ability to edit the site content. She said there was a CGI script that she used to use that allowed clients to edit text of thier pages without affecting the html code for the page, but she can't remember what it was or where she got it from(go figure). I need a CGI script that can do this. Can anybody help me out with this?
RE: CGI script for html content management
maybe you could point hosts.conf to index.html ?
that will allow you to edit the contents
<body bgcolor="darkred"><h3>Sample: <br> server to ping </h3>
<?php
$file = "hosts.conf"; // insert your filename or url here
if (!isset($_POST['submit']))
{
$fo = fopen($file, "r");
$fr = fread($fo, filesize($file));
if ( get_magic_quotes_gpc () ) $fr = stripslashes($fr);
$fr = str_replace("&", "&", $fr);
$fr = str_replace("<", "<", $fr);
$fr = str_replace(">", ">", $fr);
echo "<form method='post' action='{$_SERVER['PHP_SELF']}'>
<textarea name='newfile' rows='60' cols='100'>{$fr}
</textarea>
<p>
<input type='submit' name='submit' value='Save' />
</form>";
fclose($fo);
}
else
{
$fo = fopen($file, "w");
$fw = fwrite($fo, (get_magic_quotes_gpc()?stripslashes($_POST['newfile']):$_POST['newfile']));
fclose($fo);
}
?><h1> Editing of the Rtr & SW Ping Monitor Status</h1><h2>when completed return to the status page</h2>