Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there some way to type a URL in a text field, click submit on my page and use PHP to download all content from that URL with wget, saving the files to a folder on my server?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
166 views
Welcome To Ask or Share your Answers For Others

1 Answer

Yes.

You can use PHP exec() function (or similar) to execute external commands (such as wget).

If you need all site assets then I'd use the options for wget. Otherwise, if you just need the page content, I'd do it natively with PHP as suggested in the comment from DaveRandom.

Note: Use at your own risk... The scenario you describe is dripping with evil.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...