| | |
wget into php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2006
Posts: 59
Reputation:
Solved Threads: 1
Is there anyway I can type wget command into a php and that will download file directly from another server to my own server?
--
Share files up to 1Gb - FileOP.com
Share files up to 1Gb - FileOP.com
•
•
•
•
Is there anyway I can type wget command into a php and that will download file directly from another server to my own server?
PHP Syntax (Toggle Plain Text)
<?php $foo = system('wget http://www.myserver.com/file.txt ~',$output); ?>
Note to self... pocket cup
•
•
•
•
Is there anyway I can type wget command into a php and that will download file directly from another server to my own server?
You can however use the regular PHP functions to achive what you want to do with wget.
These are called the Stream Functions.
http://www.php.net/stream
They range from the simple functions such as:
[HTML]
// retrieve the file into a string
$file = file_get_contents('http://example.com/file.ext');
// retrieve the file into an array containing each line
$linesArray = file('http://example.com/file.ext');
[/HTML]
to a bit lower level functions such as fopen() and fsockopen() that allow a bit more flexibility.
The only restriction on the stream functions is the ability to use the HTTP wrapper for PHP Streams. This is defined in php.ini, called allow_url_fopen.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- learning php (PHP)
- PHP and scheduled tasks (PHP)
- PHP vs ASP... the big ShOwdOwN (IT Professionals' Lounge)
- Running PHP scripts in backround (PHP)
- I had a experience of a website coded in PHP (PHP)
Other Threads in the PHP Forum
- Previous Thread: get html element value using php
- Next Thread: PHP Quote form
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code confirm cron curl customizableitems database date directory display download dynamic echo email error external file files folder form forms forum function functions google headmethod href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail malfunction menu mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query question radio random recursion regex remote script search select server sessions shopping sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube






