Hey folks,
I'm in need of a little help. I'm new to PHP and have hit kind of a road block. I would like to take a query submitted by a webpage, and do a DiG on it, put the contents of the results into an array, and then using foreach(), print each line of the array to a web page. Heres the code I have:
<?
$digarray = /usr/local/bin/dig mx $query
foreach ($digarray as $result) {
print("$result<br>\n")
}
?>
Yet everytime I run it in a browser, I get:
Warning: Invalid argument supplied for foreach() in /usr/local/apache/htdocs/mxdig-results.php on line 15
Can anyone help me out with this? Its driving me up the wall!!! 🙂 Thanks!
-Aaron Nowalk