Stripslashes from this file overwriting form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scodal
    New Member
    • Jun 2012
    • 1

    Stripslashes from this file overwriting form

    Can someone help me stripslashes from this code? When you save the file with your new modifications it adds slashes anywhere it sees a "quote" and it breaks the code.

    Code:
    <head>
    <style type="text/css">
    textarea {
    font-size:11px;
    font-family:"Courier New", Courier, mono;
    	}
    </style>
    </head>
    <body>
    <?php
    
    if(isset($_POST['submit'])) {
    $content = $_POST['contents'];
    $file = fopen("nav.php", "w");
    fwrite($file, $content);
    fclose($file);
    }
    ?>
    
    <h1>Alter File</h1>
    <form name="edit" method="post">
    <textarea name="contents" cols="80" rows="23">
             <?php
                    $file = "nav.php";
                    $open = fopen($file, "r");
                    $size = filesize($file);
                    $count = fread($open, $size);
                    echo($count);
            ?>
    </textarea><br />
    	<input type="submit" name="submit" value="Submit">
    </form>
    </body>
    </html>
Working...