/ Published in: PHP
The original code was meant to be used with register_globals=on.
If you cannot or don't want to turn that on, then I have modified the code to work with register_globals=off.
If you cannot or don't want to turn that on, then I have modified the code to work with register_globals=off.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $loadcontent = "test-edit.php"; if($_POST['save_file']) { if ($fp) { print "<html><head><META http-equiv=\"refresh\" content=\"0;URL=$_SERVER[PHP_SELF]\"></head><body>"; } } for ($a = 1; $a < $count+1; $a++) { $line .= "$a\n"; } ?> <p><font face="tahoma">Simply edit the page and hit save!</font></p> <form method=post action="<?=$_SERVER[PHP_SELF]?>"> <input type="submit" name="save_file" value="Save"><br /><br /> <table width="100%" valign="top" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="3%" align="right" valign="top"><pre style="text-align: right; padding: 4px; overflow: auto; border: 0px groove; font-size: 12px; font-face:verdana;" name="lines" cols="4" rows="<?=$count+3;?>"><?=$line;?></pre></td> <td width="97%" align="left" valign="top"><textarea style="text-align: left; padding: 0px; overflow: auto; border: 3px groove; font-size: 12px; font-face:verdana;" name="savecontent" cols="150" rows="<?=$count;?>" wrap="OFF"><?=$loadcontent?>
URL: http://www.dreamincode.net/code/snippet99.htm