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

Never mind. I ended up using Perl instead - it worked straight away!

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.