| 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/backup/ |
Upload File : |
<?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,$domain)
{
// $query= "select b.name,latest_message,message_count from penpalfriends as a, penpal as b where //
//(email_u='$email' or email_f='$email') and (b.email ='$email') and b.domain='penpalamerica.com' and a.domain='penpalamerica.com'";
// first query those have you added as friends
$query2 = "select email from penpalspotlight where domain ='$domain' and email != '$email' and status ='1' and datecreated >= NOW() - INTERVAL 1 WEEK order by datecreated desc";
//echo $query2;
$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(!$result2= mysqli_query($con,$query2))
{
mysqli_close($con);
return "#";
}
else
{
$items= [];
while($row2 = mysqli_fetch_array($result2))
{
// echo $row2[0];
//innner query using top query as inputs
$query= "select name,country,email,gender,phonenumber,location,profileMessage,birthDate,photo_url1,userType,lastSeen,usertoken,
photoUpload,userStatus from penpal where email ='$row2[0]' and domain='$domain' and deleteaccount='0'";
//echo $query;
if(!$result= mysqli_query($con,$query))
{
mysqli_close($con);
return "#";
}
else
{
while($row = mysqli_fetch_array($result))
{
$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],'userType' => $row[9],'lastSeen' => $row[10],
'usertoken' =>$row[11],'photoUpload' =>$row[12],'userStatus' =>$row[13],'user_email' =>$email,'domain' => $domain
];
} //inner loop ends here
}
}//END OF WHILE
echo json_encode($items);
}
}//getUserJSON
//********************** Function ends
//$response = array();
$email=$_POST["email"];
$domain =$_POST["domain"];
getUserJSON ($email,$domain);