[英]How to download / save the content of a HTML page generated with PHP?
I'm generating a HTML / Javascript page using PHP. 我正在使用PHP生成HTML / Javascript页面。
I'd like to offer to my users, after the preview of the page, the chance to save / download, programmatically (not interactively using browser functionalities ....), the code of this HTML / Javascript page. 在页面预览之后,我想向我的用户提供以编程方式保存/下载的机会(不是交互式地使用浏览器功能......),这个HTML / Javascript页面的代码。
I've tried to search on the web for any examples but nothing appears. 我试图在网上搜索任何例子但没有出现。
Any suggestion / example? 有什么建议/例子吗? Thank you very much in advance! 非常感谢你提前!
Cesare 切萨雷
I've solved using the solution shown in this post ... 我已经解决了使用这篇文章中显示的解决方案......
https://thiscouldbebetter.wordpress.com/2012/12/18/loading-editing-and-saving-a-text-file-in-html5-using-javascrip/ https://thiscouldbebetter.wordpress.com/2012/12/18/loading-editing-and-saving-a-text-file-in-html5-using-javascrip/
I've put my code in a variable and then show it in the text area. 我将我的代码放在一个变量中,然后在文本区域中显示它。
It's working !! 它的工作!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.