Forum Discussion
bryanharley
11 years agoVisitor
Alright, well now that I'm past that dumb mistake...
Is there a more efficient way of doing these multiple calls or is this OK?
Is there a more efficient way of doing these multiple calls or is this OK?
<?php
$ch1 = curl_init('http://192.168.1.130:8060/keypress/home');
curl_setopt($ch1, CURLOPT_POST, 1);
curl_setopt($ch1, CURLOPT_POSTFIELDS, '');
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
$response1 = curl_exec($ch1);
curl_close($ch1);
$ch2 = curl_init('http://192.168.1.130:8060/launch/20802_6415');
curl_setopt($ch2, CURLOPT_POST, 1);
curl_setopt($ch2, CURLOPT_POSTFIELDS, '');
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
$response2 = curl_exec($ch2);
curl_close($ch2);
sleep(3);
$ch3 = curl_init('http://192.168.1.130:8060/keypress/select');
curl_setopt($ch3, CURLOPT_POST, 1);
curl_setopt($ch3, CURLOPT_POSTFIELDS, '');
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, true);
$response3 = curl_exec($ch3);
curl_close($ch3);
$ch4 = curl_init('http://192.168.1.130:8060/keypress/select');
curl_setopt($ch4, CURLOPT_POST, 1);
curl_setopt($ch4, CURLOPT_POSTFIELDS, '');
curl_setopt($ch4, CURLOPT_RETURNTRANSFER, true);
$response4 = curl_exec($ch4);
curl_close($ch4);
$ch5 = curl_init('http://192.168.1.130:8060/keypress/select');
curl_setopt($ch5, CURLOPT_POST, 1);
curl_setopt($ch5, CURLOPT_POSTFIELDS, '');
curl_setopt($ch5, CURLOPT_RETURNTRANSFER, true);
$response5 = curl_exec($ch5);
curl_close($ch5);
?>