hi guys, just wanna know, how could i download a file using php script? it is possible with visual basic 6 but the problem is how would i do that using php???
xuexue
15
Junior Poster
Recommended Answers
Jump to PostTo download just the single html file or store it in a variable then the following will do the trick:
<? $webpage=file_get_contents('http://www.php.net/'); //now to save the variable to a html …
Jump to PostIf you mean multiple url's then the following will loop through an array to save each of those files:
<? $links=array('http://www.example.com/', 'http://www.example.com/test.doc', 'http://www.mysite.com/file.xls', '
Jump to PostSimply link to another page or same page where filesaving fails to pass if statement. Below is an example:
<? if ($_GET['id']=='save') { $links=array('http://www.example.com/', 'http://www.example.com/test.doc', '
All 9 Replies
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
xuexue
15
Junior Poster
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
xuexue
15
Junior Poster
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
xuexue
15
Junior Poster
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
almostbob
866
Retired: passive income ROCKS
xuexue
15
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.