Jump to content

recive wget log from php web page


adman82

Recommended Posts

hi there ,

I'm trying  to make a php page that will download a file with wget , and after the download show statistics , such as average speed , file size .

 

i tested all of the oppions to run shell command .

 

$result = system("wget -O tmp1 '$url' ");
echo "the system results are: ".$result."<br>";
echo "<br>the shell_exec results are: "  ;
  echo shell_exec("wget -O tmp2 '$url' ")."<br>";
   $test = exec("wget -O tmp3 '$url' ",$tmp);
print_r($tmp); 
   echo "<br>the exec results are: ";
   print_r( $test);

$test1 = `wget -O tmp4 "$url" `;
   echo "<br>the gershaim results are: ";
   echo "<pre>$test1</pre>";

$string = system('wget http://www.example.com/index.html ~',$file);

echo $string; 
echo ' "test"';

 

and the results are :

the system results are:

the shell_exec results are:
Array ( )
the exec results are:
the gershaim results are: "test"  

 

All help is appreciated ,

 

thanks with advance ...

Link to comment
https://forums.phpfreaks.com/topic/196308-recive-wget-log-from-php-web-page/
Share on other sites

// add error reporting just to make sure errors are sown.
error_reporting(E_ALL);
ini_set('display_errors', 'on');

$result = system("wget -O tmp1 '$url' ");
echo "the system results are: ".$result."<br>";
echo "<br>the shell_exec results are: "  ;
  echo shell_exec("wget -O tmp2 '$url' ")."<br>";
   $test = exec("wget -O tmp3 '$url' ",$tmp);
print_r($tmp); 
   echo "<br>the exec results are: ";
   print_r( $test);

// $test1 = `wget -O tmp4 "$url" `;
$test1 = '`wget -O tmp4 "' . $url . '"`'; // ecased in single quotes.
   echo "<br>the gershaim results are: ";
   echo "<pre>$test1</pre>";

$string = system('wget http://www.example.com/index.html ~',$file);

echo $string; 
echo ' "test"';

 

Not exactly sure what you are expecting to get, but hopefully the error reporting and the $test1 line help get you on your way.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.