html - _GET method php -
i making texteditor website fun me , got of going down. now, wondering having issue transfer of data _get
method in php , won't write files if <
(<). has <
odd reason. there easy method override when transfer it? find way, wanted know if there simple way.
editor file:
<html> <head> <title>web editor</title> <link href="controller.css" rel="stylesheet"/> <script type="text/javascript" src="script/editor.js"></script> </head> <body> <div class="platform"> <div class="head"><div class="file"><p>file: <div id="file">hello.html</div></p></div></div> <div class="hotbar"><img src="images/save.png" class="hotbarimage" onclick="save()" /> </div> <div class="editor"><div contenteditable="true" style="height:100%; overflow:scroll;" id="editpad" ></div></div> </div> </body> </html>
php file:
<?php $dir = $_get['dir']; $data = $_get['data']; $f = fopen($dir,"w"); fwrite($f,$data); fclose($f); ?>
save js file:
function save() { var dir = document.getelementbyid("file").innerhtml; var data = document.getelementbyid("editpad").innerhtml; window.location = "save.php?dir="+dir+"&data="+data; }
it's not complete cause started today, working on of basics functions.
html_entity_decode('<')
Comments
Post a Comment