I've to invoke this url in my Ubuntu 15.10 ...
http://listeps.cittadellasalute.to.it/?id=01090101
using curl both from command line and from PHP.
I've notice that no parameters are considered if I simply submit
curl 'http://listeps.cittadellasalute.to.it/?id=01090101'
You can note that no number appears in the result, exactly the same behaviour that you've if submit
curl 'http://listeps.cittadellasalute.to.it/'
The same using this PHP code
<?php
ini_set('display_errors', 1);
$url = 'http://listeps.cittadellasalute.to.it/?id=01090101';
//#Set CURL parameters: pay attention to the PROXY config !!!!
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_PROXY, '');
$data = curl_exec($ch);
curl_close($ch);
$dom = new DOMDocument();
@$dom->loadHTML($data);
$xpath = new DOMXPath($dom);
$greenWaitingNumber = $xpath->query('/html/body/div/div/div[4]/div[3]/section/p');
foreach( $greenWaitingNumber as $node )
{
echo "Number first green line: " .$node->nodeValue;
echo '<br>';
echo '<br>';
}
?>
How may I using the url parameter both using curl from command line and in my PHP code?
sudo apt-get install curl