php - Populate file contents in value field of a text box -


i created text box follows-

<textarea name ="textbox" rows="20" cols="50" id ="textbox" style="background-color: #000000; font-size:14.5px; font-family:arial; color:#ffffff;"> </textarea>'; 

in php script,i trying contents of file , trying populate value field of textbox follows :

echo '<script> document.getelementbyid("textbox").value = "'.$final1.'";</script>';  $final1 = file_get_contents(filename); 

i see there nothing populated in value field , neither see output when try echo variable. tried giving variable $test = "abcd"; , populating variable , worked.

i know has html special characters because file has lot of special characters not able find solution.

kindly please help. thanks!

if problem related file load having special characters in html/javascript not try this

$final1 = htmlspecialchars( file_get_contents(filename) ); echo '<script> document.getelementbyid("textbox").value = "'.$final1.'";</script>'; 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -