<?php
require("Easycurl.class.php");
$url="http://192.168.15.1:8000/";
$data=array(
"auth_user"=>"admin",
"auth_pass"=>"admin",
"redirurl"=>"",
"accept"=>"ACCETTA+E+CONTINUA"
);
$options=array(
CURLOPT_URL=>$url,
CURLOPT_POST=> 1,
CURLOPT_POSTFIELDS=>http_build_query($data),
CURLOPT_FOLLOWLOCATION=> 1,
CURLOPT_RETURNTRANSFER=>1
);
$ch = new curl($options);
$result= $ch->result();
//echo $result.PHP_EOL;
if(strstr($result,'Logout'))
{
printf("Login was Successfull\n");
}else
{
printf("Login was unSuccessfull\n");
}
?>
|