0

Hi all,
How can I execute an external program (wget) on a linux box? I assume I should be using exec() or something similar.
The command I'm trying to execute is:

wget -p 'x.x.x.x/inventory.ssi?mag_0=1&mag_1=1'

Which returns the html page of inventory. I am then parsing the file using DOMDocument to extract the relevant text.
Running this in the terminal yields the result I want.

If I simply do this:

exec("wget", $ret);
	foreach($ret as $value)
	{
		echo $value;
	}

Then it prints the wget usage options to the browser, but issuing my command seems to do nothing?
Cheers

Edited by nonshatter: n/a

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by nonshatter
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.