Skippy
01-07-2010, 05:32 PM
I'm building a little script for myself where it'll get the html from a file so it can be edited.
This is my code:
<?php
echo "<form name=\"myform\" action=\"\" method=\"POST\">";
echo "<textarea rows=\"20\" cols=\"50\>";
$str=htmlentities(file_get_contents('otherheader.php'));
echo $str;
echo "</textarea>";
echo "<input type=\"submit\" value=\"Submit\">";
echo "</form>";
?>
When I take away the form bit it works however when I put the form part in it just returns </form> within the text area. How can I stop this?
Thanks.
sir.jones
01-07-2010, 06:23 PM
go and appropriate to http://php.net/manual/en/function.htmlentities.php
sir.jones
01-07-2010, 06:58 PM
When I take away the form bit it works however when I put the form part in it just returns </form> within the text area. How can I stop this?
Thanks.
Your Code change to:
<form name="myform" action="" method="POST">
<textarea rows="20" cols="50">
<?php
//$charse='UTF-8';
//$str=stripcslashes($str);
$str=file_get_contents('yourpage.html/.php/.chm/.txt');
echo htmlentities($str);
//echo htmlentities($str, ENT_COMPAT, $charset);
?>
</textarea>
<input type="submit" value="Submit">
</form>
:thumbsup:
Regards
@skippy;
Whether your code was fundamenatlly OK, I don;t know but you missed off your closing " on line 2 in your OP.
echo "<textarea rows=\"20\" cols=\"50\>";
should have been
echo "<textarea rows=\"20\" cols=\"50\">";
I would try sir.jones code though since it seems to make more sense to me.
bazz
_Aerospace_Eng_
01-07-2010, 09:01 PM
Bazz is right. Fix your php.
echo "<textarea rows=\"20\" cols=\"50\">";
sir.jones
01-07-2010, 10:57 PM
From 1st time i look Skype code i kown him/her missed close with " at cols=\"50\" but my code model able to avoid it.
that's mean someone save his/her time if work with thousand html tags line
sir.jones
01-07-2010, 10:57 PM
From 1st time i look Skippy code i kown him/her missed close with " at cols=\"50\" but my code model able to avoid it.
that's mean someone save his/her time if work with thousand html tags line