<?php
$ip=$_GET["ip"];
function firstplug($ip)
	{
	$nuevo=false;
	//echo($ip);
	$url = "http://$ip/cgi-bin/login_handle";
	$fields = array(
	'auth' => urlencode(""),
	'login' => urlencode("  Enter  ")
				);
	$fields_string="";
	foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
	rtrim($fields_string, '&');
	$ch = curl_init();
	curl_setopt($ch,CURLOPT_URL, $url);
	curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch,CURLOPT_POST, count($fields));
	curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
	$result = curl_exec($ch);
	if (strpos($result, "Password Incorrect!")!==false) $nuevo=false;
	else $nuevo=true;
	curl_close($ch);
	return $nuevo;
	}
if (firstplug($ip)) echo("1");
else echo("0");
?>