Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.