abahaedini Posted June 4, 2012 Share Posted June 4, 2012 (edited) hi there I want to transfer an external webpage (like a youtube page with all its objects like video,images,text,...) to a folder in my server (only with server and Without user browser ) is it possible? can sb give me some idea to do it? (when a user type an external url in my site, The server upload and bring that page into mysitelike an unti filter scripts) Edited June 4, 2012 by abahaedini Link to comment Share on other sites More sharing options...
Ingolme Posted June 4, 2012 Share Posted June 4, 2012 You can use the cURL library to load the HTML. After that you have to save the HTML code to a file (file_put_contents()) and then parse the HTML to look for all the possible resources it uses. If there are CSS stylesheets, you need to parse those to extract any resources that the stylesheet uses as well. Once you have all the links to all the resources you need to use cURL to extract their content as well and save those to files. You also have to make sure to update the links to resources from the HTML and CSS pages so that they match your current directory structure. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now