Copy source code of a webpage

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
sanju
Forum Commoner
Posts: 65
Joined: Sat Jun 21, 2008 2:15 am
Location: Kochi, India

Copy source code of a webpage

Post by sanju »

Hi all,

I have a dynamic newsletter template and I need to copy the source code of this webpage with a click of a button and need to save it for sending the emails. How can i do that,


Any one pls help
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Copy source code of a webpage

Post by pickle »

The only way I can think of is using an AJAX request to ask for the code again. You have to do a new request because that's the only way to get the code as a string. Browsers convert it into the DOM and may do some modification to the code. Once you have the code again, I'm pretty sure Javascript can access the clipboard somehow.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Copy source code of a webpage

Post by AbraCadaver »

What programming languages are available? PHP? Where is the template? Where do you want to save it, in a variable, in another file?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply