开发者

How to make html file from textarea content

开发者 https://www.devze.com 2023-03-31 02:23 出处:网络
I want to create a html file from the contents fetched from the textarea. I want to know, how to save the html file and how will I get this html file in my location from the content shown below

I want to create a html file from the contents fetched from the textarea.

I want to know, how to save the html file and how will I get this html file in my location from the content shown below

'<te开发者_JAVA百科xtarea id="Textarea"><html><head></head><body>Hai</body></html></textarea>`


When you submit the text area content, the server side code should create file with these contents and save it at a location which is accessible to the browser via some URL.


If you want to write to a file using JavaScript you can't. You can pass document.getElementById('Textarea').innerHTML to a webservice that will save it's output to a file...


The following did the magic for me: $message = str_replace('&lt;','<',$message); $message = str_replace('&gt;','>',$message);

0

精彩评论

暂无评论...
验证码 换一张
取 消