Click here to Skip to main content
15,888,088 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to save a web page in a text file, automatically by using PHP or JavaScript
Posted

I don't do PHP ( I think it's rubbish ), so I waited to see if you'd get a better answer, but....

javascript isn't going to save a file for you, it doesn't do that. You don't say if you want to save the full HTML, or some sort of text representation, but you make the browser save a file by setting the header for the response to tell it that it's an attachment, then you can push whatever text you want down to the browser.
 
Share this answer
 
Do you mean save the output which is sent to the browser?

You can do this using Output Buffering[^] and saving the buffer as a text file.

This Tip/Trick[^] shows how to save the output.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900