hey, first post here! 🆒
I was wondering if anyone could possibly help me with this.
I have made up a script on my website that displays a text box area that can be edited. (Basically for copy and pasting large text messages to friends) I finished setting it up, and I was sorta happy with the end result, but then I tried to execute PHP code within this, and it allowed it :queasy:
These are the files that I'm using:
dump.php (To display and change the text)
post.php (To phrase the text to a .txt document)
text.txt (The file that stores the text)
The form on dump.php is as follows:
<form id="form1" name="form1" method="post" action="post.php">
<label>
<textarea name="textfield" cols="100" rows="25"><?php include_once("./stats/text.txt"); ?>
</textarea>
<div align="left"></div>
<input type="submit" value="Save" />
</p>
</label>
</form>
and my post.php is as follows:
<?php
if(isset($_POST['textfield']))
{
$File = "./stats/text.txt";
$Handle = fopen($File, 'w');
$Data = "{$_POST['textfield']}\n";
fwrite($Handle, $Data);
fclose($Handle);
header( 'Location: dump.php' ) ;
}
?>
The question here was to try and disable execution of PHP code within this. If anyone could help me out that would be great, thanks! 🆒