| 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/penpaleurope.com/backup/app/ |
Upload File : |
<?php
include "general.php";
include "connect.php";
include 'sendmailclient.php';
function rand_string( $length ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$size = strlen( $chars );
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}
return $str;
}
function rand_string2( $length ) {
$chars = "0123456789";
$size = strlen( $chars );
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}
return $str;
}
//**************************
//**************************
// end of function
$username =$_POST["name"];
$pass =$_POST["pass"];
//echo $username ."<br>";
$location =$_POST["location"];
//echo $location."<br>";
$email =$_POST["email"];
//echo $email."<br>";
$phonenumber =$_POST["phone"];
//echo $phonenumber."<br>";
$profile =$_POST["profile"];
//echo $profile."<br>";
//die();
$country =$_POST["country"];
//echo $country."<br>";
$sex =$_POST["sex"];
$age =$_POST["age"];
date_default_timezone_set('africa/lagos');
if ($username =="" || $profile =="" || $email == "" || $phonenumber =="" || $age =="" || $location =="" || $country =="" || $pass ==""){
header('Location: register.php?err=2');
die();
}
if (strlen($username) < 3){
header('Location: register.php?err=3');
die();
}
if (strlen($pass) < 3){
header('Location: register.php?err=3');
die();
}
//echo "nosa";
if (!is_numeric($age)){
header('Location: register.php?err=7');
die();
}elseif ($age < 18) {
header('Location: register.php?err=23');
die();
}
if (strlen($profile) < 30){
header('Location: register.php?err=4');
die();
}
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email)) {
header('Location: register.php?err=5');
die();
}
if (strlen($phonenumber) < 7){
header('Location: register.php?err=6');
die();
}
if ($country=="Nigeria")
{
if( !is_numeric($phonenumber)){
header('Location: register.php?err=26');
die();
}
if ((strlen($phonenumber) < 13) || (strlen($phonenumber) > 13) ){
header('Location: register.php?err=8');
die();
}
if(substr($phonenumber,0,3) != "234"){
header('Location: register.php?err=9');
die();
}
if(substr($phonenumber,0,4) == "2340"){
header('Location: register.php?err=27');
die();
}
}
if ($country=="Ghana")
{
if( !is_numeric($phonenumber)){
header('Location: register.php?err=26');
die();
}
if (strlen($phonenumber) != 12){
header('Location: register.php?err=18');
die();
}
if(substr($phonenumber,0,3) != "233"){
header('Location: register.php?err=19');
die();
}
if(substr($phonenumber,0,4) == "2330"){
header('Location: register.php?err=19');
die();
}
if(substr($phonenumber,0,4) == "233 "){
header('Location: register.php?err=19');
die();
}
}
if ($country=="South Africa")
{
if( !is_numeric($phonenumber)){
header('Location: register.php?err=26');
die();
}
if (strlen($phonenumber) != 11){
header('Location: register.php?err=20');
die();
}
if(substr($phonenumber,0,2) != "27"){
header('Location: register.php?err=21');
die();
}
if(substr($phonenumber,0,3) == "270"){
header('Location: register.php?err=21');
die();
}
if(substr($phonenumber,0,3) != "27 "){
header('Location: register.php?err=21');
die();
}
}
//check if email already exists
$query = "Select email from penpalsubscriber where email ='$email'";
$response =getQuery1($query);
if ($response != "#")
{
header('Location: register.php?err=11');
die();
}
//check if phonenumber already exists
$query = "Select msisdn from penpalsubscriber where msisdn ='$phonenumber'";
$response =getQuery1($query);
if ($response != "#")
{
}
$transID= generateTransID();
$myMessage ="<!doctype html> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> <title>Responsive Email Template</title> <style type='text/css'> .ReadMsgBody {width: 100%; background-color: #ffffff;} .ExternalClass {width: 100%; background-color: #ffffff;} body {width: 100%; background-color: #ffffff; margin:0; padding:0; -webkit-font-smoothing: antialiased;font-family: Georgia, Times, serif} table {border-collapse: collapse;} @media only screen and (max-width: 640px) { body[yahoo] .deviceWidth {width:440px!important; padding:0;} body[yahoo] .center {text-align: center!important;} } @media only screen and (max-width: 479px) { body[yahoo] .deviceWidth {width:280px!important; padding:0;} body[yahoo] .center {text-align: center!important;} } </style> </head> <body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' yahoo='fix' style='font-family: Georgia, Times, serif'> <!-- Wrapper --> <table width='100%' border='0' cellpadding='0' cellspacing='0' align='center'> <tr> <td width='100%' valign='top' bgcolor='#ffffff' style='padding-top:20px'> <!-- Start Header--> <table width='580' border='0' cellpadding='0' cellspacing='0' align='center' class='deviceWidth' style='margin:0 auto;'> <tr> <td width='100%' bgcolor='#ffffff'> <!-- Logo --> <table border='0' cellpadding='0' cellspacing='0' align='left' class='deviceWidth'> <tr> <td style='padding:10px 20px' class='center'> <a href='#'><img src='http://www.penpalafrica.com/email/penpalemaillogo.png' alt='PenpalAfrica Logo' border='0' /></a> </td> </tr> </table><!-- End Logo --> <!-- Nav --> <table border='0' cellpadding='0' cellspacing='0' align='right' class='deviceWidth'> <tr> <td class='center' style='font-size: 13px; color: #272727; font-weight: light; text-align: right; font-family: Georgia, Times, serif; line-height: 20px; vertical-align: middle; padding:10px 20px; font-style:italic'> <a href='http://www.penpalafrica.com/index.php' style='text-decoration: none; color: #3b3b3b;'>Home</a> <a href='http://www.penpalafrica.com/login.php' style='text-decoration: none; color: #3b3b3b;'>Login</a> <a href='http://www.penpalafrica.com/faq.html' style='text-decoration: none; color: #3b3b3b;'>FAQ</a> </td> </tr> </table><!-- End Nav --> </td> </tr> </table><!-- End Header --> <!-- One Column --> <table width='580' class='deviceWidth' border='0' cellpadding='0' cellspacing='0' align='center' bgcolor='#eeeeed' style='margin:0 auto;'> <tr> <td valign='top' style='padding:0' bgcolor='#ffffff'> <a href='http://www.penpalafrica.com/'><img class='deviceWidth' src='http://www.penpalafrica.com/email/penpalmaillogo.png' alt='PenpalLogo' border='0' style='display: block; border-radius: 4px;' /></a> </td> </tr> <tr> <td style='font-size: 13px; color: #959595; font-weight: normal; text-align: left; font-family: Georgia, Times, serif; line-height: 24px; vertical-align: top; padding:10px 8px 10px 8px' bgcolor='#eeeeed'> <table> <tr> <td valign='middle' style='padding:0 10px 10px 0' colspan='2'><a href='#' style='text-decoration: none; color: #272727; font-size: 16px; color: #272727; font-weight: bold; font-family:Arial, sans-serif '>PenpalAfrica Registration</a> </td> </tr> </table> Dear <b>##username##</b><br><br /> You provided us the following information during registration:<br><br /> Phonenumber:<b>##phone##</b><br /> Age:<b>##age##</b><br /> Sex:<b>##sex##</b><br /> Location:<b>##location##</b><br /> Country:<b>##country##</b><br /> Email:<b>##email##</b><br /> Profile:<b>##profile##</b><br /> Use the link below to activate your account.<br /><br /> <div><!--[if mso]> <v:rect xmlns:v='urn:schemas-microsoft-com:vml' xmlns:w='urn:schemas-microsoft-com:office:word' href='#' style='height:40px;v-text-anchor:middle;width:200px;' stroke='f' fillcolor='#008000'> <w:anchorlock/> <center> <![endif]--> <a href='http://www.penpalafrica.com/activateac.php?id=##messageid##&en=##encry##' style='background-color:#4ECDF6;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;'>Activate Account</a> <!--[if mso]> </center> </v:rect> <![endif]--></div> <br/>Thanks for your interest in our service.<br> PenpalAfrica Team <br/> </td> </tr> </table><!-- End One Column --> <!-- 4 Columns --> <table width='100%' border='0' cellpadding='0' cellspacing='0' align='center'> <tr> <td bgcolor='#363636' style='padding:30px 0'> <table width='580' border='0' cellpadding='10' cellspacing='0' align='center' class='deviceWidth' style='margin:0 auto;'> <tr> <td> <table width='45%' cellpadding='0' cellspacing='0' border='0' align='left' class='deviceWidth'> <tr> <td valign='top' style='font-size: 11px; color: #f1f1f1; color:#999; font-family: Arial, sans-serif; padding-bottom:20px' class='center'> You are receiving this email because<br/> 1.) You are subscriber of penpalafrica.com or<br/> 2.) You subscribed via <a href='http://www.penpalafrica.com' style='color:#999;text-decoration:underline;'>our website</a><br/> <br/><br/> Want to be removed? No problem, <a href='http://www.penpalafrica.com/unsubscribe.php?id=##messageid##&en=##encry##' style='color:#999;text-decoration:underline;'>click here</a> and we will not send you messages again. </td> </tr> </table> <table width='40%' cellpadding='0' cellspacing='0' border='0' align='right' class='deviceWidth'> <tr> <td valign='top' style='font-size: 11px; color: #f1f1f1; font-weight: normal; font-family: Georgia, Times, serif; line-height: 26px; vertical-align: top; text-align:right' class='center'> <a href=''><img src='http://www.penpalafrica.com/email/footer_rss.gif' width='42' height='42' alt='RSS Feed' title='RSS Feed' border='0' /></a> <a href=''><img src='http://www.penpalafrica.com/email/footer_twitter.gif' width='42' height='42' alt='Twitter' title='Twitter' border='0' /></a> <a href=''><img src='http://www.penpalafrica.com/email/footer_vm.gif' width='42' height='42' alt='Vimeo' title='Vimeo' border='0' /></a> <a href=''><img src='http://www.penpalafrica.com/email/footer_fb.gif' width='42' height='42' alt='Facebook' title='Facebook' border='0' /></a> <br /> <a href='#' style='text-decoration: none; color: #848484; font-weight: normal;'>support@penpalafrica.com</a> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table><!-- End 4 Columns --> </td> </tr> </table> <!-- End Wrapper --> <div style='display:none; white-space:nowrap; font:15px courier; color:#ffffff;'> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - </div> </body> </html>";
date_default_timezone_set('africa/lagos');
$query = "select id from palid where sn = 1";
$queryresponse = getQuery1($query);
$palid = (int)($queryresponse) + 1;
$query = "update palid set id ='". (string) $palid ."' where sn =1";
$response = updateQuery( $query);
$photo ="0";
//remove poison;
$username = str_replace("'","^",$username);
$location = str_replace("'","^",$location);
$profile = str_replace("'","^",$profile);
$country = str_replace("'","^",$country);
$query ="INSERT INTO Enquiry (username,phonenumber, email,smscode,emailcode,domain, dateused) VALUES ('". $username."','". $phonenumber ."','". $email."','". $sex . "','".$location."','". $domain. "','". date('Y-m-d H:i:s')."')";
$queryresponse = updateQuery($query);
//check if phonenumber already exists
$query = "Select msisdn from penpalsubscriber where msisdn ='$phonenumber'";
$response =getQuery1($query);
if ($response == "#"){
$query ="insert into penpalsubscriber (nickname,msisdn,email,country,location,age,sex,profile,status,engine,palid,pass,domain) VALUES
('$username','$phonenumber','$email','$country','$location','$age','$sex','$profile','0','5','$palid',password('$pass'),'$domain')";
}
else{
$query ="update penpalsubscriber set nickname='$username',email='$email',country='$country',location='$location',age='$age',sex='$sex',profile='$profile',status='0',engine='5',vemail='0',photo ='0',palid ='$palid',pass=password('$pass'),domain='$domain' ,vphonenumber ='1' where msisdn ='$phonenumber'";
}
$queryresponse = updateQuery($query);
if($queryresponse=="0"){
//$mess = "Bravo, Registration completed!\nPlease Check your email for Activation link. \nIf you cannot find the email in your inbox, kindly check SPAM folder\nwww.penpalafrica.com";
//$messageout = "'" . $phonenumber . "','" . $sender . "','" . $mess . "','0','" .$engine. "'";
//$query = "insert into Penpalmessagesent ( msisdn,sender,message,flag,engine) values (" . $messageout . ")";
//$queryresponse = updateQuery($query);
//$_SESSION['palid'] =$palid;
$mysub = "Registration Completed - " . $domain;
//$myMessage ="Dear <b>". $username. "</b>,<br><br>";
//get emailID;
$emailID = rand_string(30);
$encryID = rand_string(20);
$query = "insert into penpalactivation ( palid,messageid,encryption,status) values ('$palid','$emailID','$encryID','0')";
$queryresponse=updateQuery($query);
// $query= "update penpalverify set status='1' where msisdn ='$phonenumber'";
// $queryresponse=updateQuery($query);
//replace emailid and encryid in email messages
$myMessage =str_replace("##username##",$username,$myMessage);
$myMessage =str_replace("##messageid##",$emailID,$myMessage);
$myMessage =str_replace("##encry##",$encryID,$myMessage);
$myMessage =str_replace("##phone##",$phonenumber,$myMessage);
$myMessage =str_replace("##age##",$age,$myMessage);
$myMessage =str_replace("##sex##",$sex,$myMessage);
$myMessage =str_replace("##location##",$location,$myMessage);
$myMessage =str_replace("##country##",$country,$myMessage);
$myMessage =str_replace("##email##",$email,$myMessage);
$myMessage =str_replace("##profile##",$profile,$myMessage);
$myMessage =str_replace("##pin##",$palid,$myMessage);
//send email
$gate="1";
$mymail = sendmailtoclient($email,$myMessage,$myMmessage,$mysub,$mfrom,$mfromname,$gate);
header('Location: login.php?err=0');
die();
}
else
{
header('Location: register.php?err=13');
die();
}
?>