Jump to content

upload an external page to current server


abahaedini

Recommended Posts

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 by abahaedini
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...