All pastes #93551 Raw Edit

hex.php

public text v1 · immutable
#93551 ·published 2006-07-20 15:37 UTC
rendered paste body
<div id="maintitle">
    Edit a File
</div>
<div id="postbody">
<form action="?act=editfilephp1" method="post">
    <br><br><center>Which file would you like to edit? (example: posts.txt) (example: stylesheet.css)&nbsp;&nbsp;
<textarea rows=1 cols=100 name="filename">enter your file name and extension</textarea></center><br><br><br><br><br><br><br>
</div>
<div id="postfooter">
<input type="submit" id="submit" value="Edit File" /></form>
</div>
        </body>
    </html>
    <?php
} elseif ( $_GET['act'] == editfilephp1 ) {
    $file= "{$_POST['filename']}";

if ( $file == "posts.txt" || "posts") {
        $file="posts.txt";
        $handle=fopen('posts.txt', 'w');
        ?>

    <br><br><center>Editing posts.txt<br>
    <textarea rows=50 cols=100><?php echo file_get_contents('posts.txt'); ?> </textarea></center><?
    
} elseif ($file == "stylesheet.css" ) {
        $file="stylesheet.css";
        $handle=fopen('stylesheet.css', 'w');
        ?>

    <br><br><center>Editing stylesheet.css<br>
    <textarea rows=50 cols=100><?php echo file_get_contents('stylesheet.css'); ?> </textarea></center><?
    
} elseif ($file == "index.php" || "index" || "index file" || "index.html") {
        $file="index.php";
        $handle=fopen('index.php', 'w');
        ?>
        
    <br><br><center>Editing index.php<br>
    <textarea rows=50 cols=100><?php echo file_get_contents('index.php'); ?> </textarea></center><?
    
} else {
    ?>
    Permission to edit <b>has been denied</b>
    <?
}
}
    ?>