| 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/chatme24.com/wwwroot/register/ |
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 rand_string2( $length ) {
$chars = "0123456789";
$size = strlen( $chars );
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}
return $str;
}
//$response = array();
$name =$_POST["name"];
$email =$_POST["email"];
$phonenumber =$_POST['phonenumber'];
$location =$_POST["location"];
$profileMessage =$_POST["profileMessage"];
$country =$_POST["country"];
$gender =$_POST["gender"];
$birthDate =$_POST["birthDate"];
$password =$_POST["password"];
$photo_url1 =$_POST["photo_url1"];
date_default_timezone_set('africa/lagos');
$name = str_replace("'","^",$name);
$location = str_replace("'","^",$location);
$profileMessage = str_replace("'","^",$profileMessage);
$country = str_replace("'","^",$country);
//check if phonenumber already exists
$query = "Select phonenumber from penpalamerica where email ='$email'";
$myresponse =getQuery1($query);
//echo $response;
if ($myresponse == "#"){
if (($phonenumber !="") && ($email != "") && ($name != "")){
$emailcode =rand_string2(6);;
$query ="insert into penpalamerica (name,phonenumber,email,emailcode, country,location,gender,birthDate,photo_url1,profileMessage,password) VALUES
('$name','$phonenumber','$email','$emailcode','$country','$location','$gender','$birthDate','$photo_url1','$profileMessage',"."password('".$password."'))";
//echo $query;
$queryresponse = updateQuery($query);
echo "0";
die();
}else{
echo "2";
die();
}
}
else{
echo "1";
die();
}
?>