MOON
Server: Apache
System: Linux ip-208-109-13-31.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els4.x86_64 #1 SMP Sat Aug 31 06:58:57 UTC 2024 x86_64
User: durgeshpandey215 (1013)
PHP: 8.1.29
Disabled: NONE
Upload Files
File: /home/durgeshpandey215/www/zeeroprice.skilladders.com/register.php
<? require "application_top.php";
	
	if(isset($_SESSION['token']) && isset($_POST['token']) && ($_POST['token']==$_SESSION['token'])){
		
		$fullname = ucwords($_REQUEST['fullname']);
		$emailid = $_REQUEST['emailid'];
		$mobno = $_REQUEST['mobileno'];
		$ipassword = md5($_REQUEST['ipassword']);
		
		if($mobno < 7000000000){
			$_SESSION['msg'] = "Please enter valid mobile number";
			header('location:'.$_SERVER["HTTP_REFERER"]);exit;
		}
		
		$db->where('mobno',$mobno);
		$rowu = $db->getOne('register');
		
		if(!$rowu){ //register user in db	
		for($i=1;$i<=1;$i++){
			$Files_pic_name = $_FILES['pic'.$i]['name'];
			$Files_pic_temp_name = $_FILES['pic'.$i]['tmp_name'];
			$needOriginal = 1;
			$pathOriginal = "images/photos/photosThumbs/";
			$needThumb = 0;
			$pathThumb = "";
			require "upload.php";
			${'pic'} = $pic;
		}
		$verifycode = rand(11111,99999);
		$insertdata = array(
			'pic1'=>$pic,
			'fullname'=>$fullname,
			'emailid'=>$emailid,
			'mobno'=>$mobno,
			'ipassword'=>$ipassword,
			'istatus'=>0,
			'verified'=>0,
			'postedon'=>date('Y-m-d H:i:s'),
			'verifycode'=>$verifycode
		);	
		$db->insert('register',$insertdata);
		$userid = $db->getInsertId();
		$messagetosent ="<table style='margin-left:auto;margin-right:auto;width:600px;border:1px solid #522162;font-family:tahoma' border='0'>
				<tr>
					<td style='background-color:#ffff51;color:#ffffff;padding:2px;border-bottom:1px solid #8f8f8f'><center><img src='".HTTP_SERVER."images/defaultuser.png' width='100'/></center></td>
				</tr>
				<tr>
					<td style='padding-left:15px;color:#0891D4;'>
						<br/>
						Dear ".$fullname." <br/>
						Congratulations!<br/><br/>
						Your profile has been successfully created <br/>
						<div style='background-color:#0891D4;color:#ffffff;border:10px solid #cccccc;margin-top:10px;width:150px;padding:10px;text-align:center;'>
							Click to <br/>activate your Profile<br/><br/><div style='background-color:#cccccc;border:1px solid #000000;padding:3px;'>
							<a href='".HTTP_SERVER."confirm.php?userid=".encode($userid)."&mobno=".encode($mobno)."&otp=".$verifycode."' style='color:#000000;text-decoration:none;'>Click Here</a></div>
						</div><br/>
						Alternatively you can copy paste the following line to the browser's address bar and hit enter<br/><br/>
						".HTTP_SERVER."confirm.php?userid=".encode($userid)."&mobno=".encode($mobno)."&otp=".$verifycode."
						<br/>
						<br/>
						Thank You!<br/>
						Team<br/>
						".HTTP_SERVER."
						<br/><br/>
					</td>
				</tr>
				</table>";
		$subjecttosend = "Verify Registration";
		$sendtoname = $fullname;
		$successmesage = "<h1>Thanks for signing up!</h1><br/>we have sent a verification link to your e-mail address.<br/>
		Please click on the verification link to help us create your account.<br/><br/>		
		Please Note<br/>
		It might take upto 2-3 minutes for verification mail to arrive.<br/>
		Please check your Spam/Junk/Promotions folder as well if you don't receive the mail in your Inbox.";
		if($emailid){
		sendemail($emailid,$subjecttosend,$messagetosent,$sendtoname,$successmesage);
		}
		$urlencodemsg = urlencode("Dear ".$fullname." Thank you for registering. Your verification code is ".$verifycode);
		if($mobno){
		$filetocall = "http://bulksms.mysmsmantra.com/WebSMS/SMSAPI.jsp?username=hemantjd&password=1565540550&sendername=AIROLI&mobileno=".$mobno."&message=".$urlencodemsg;
		//file_get_contents($filetocall);
		}
			
			$_SESSION['msg']="Verify your account";
			$redirect_url = 'verifyac.php?id='.encode($mobno);
			header("Location: $redirect_url", true, 303);
			exit;
		}else{
			$_SESSION['msg'] = "Mobile number already exists. Please login <a href=login.php>here</a>";
			header("location:register.php");exit;
		}
	}

//form token below
$token = md5(uniqid(rand(), true));
$_SESSION['token'] = $token;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<? require "scripts.php";?>
</head>
<body>

<? $pagename = "register"; require "header.php";?>

<h1>Register</h1>
	
<div class="w3-card w3-white">
	<div class="w3-blue w3-container w3-padding">Register New account</div>
	<form action="<?=$_SERVER['PHP_SELF'];?>" method="post" id="commonform" enctype="multipart/form-data">		
	<div class="w3-row w3-padding">
		<div class="w3-col m4">
		<!--following 2 lines prevent chrome to autofil saved username n password -->
		<input style="display:none">
		<input type="password" style="display:none">
		
		<center>
		Your Display Pic 
			<br/>
			<script type="text/javascript">
				$(function() {
					<? for($i=1;$i<=1;$i++){?>
					$("#pic<?=$i;?>").on("change", function()
					{
						var files = !!this.files ? this.files : [];
						if (!files.length || !window.FileReader){ // no file selected, or no FileReader support
							//imgDiv1
						return; 
						}
						
						if (/^image/.test( files[0].type)){ // only image file
							var reader = new FileReader(); // instance of the FileReader
							reader.readAsDataURL(files[0]); // read the local file

							reader.onloadend = function(){ // set image data as background of div
								$("#imgpic<?=$i;?>").attr("src", this.result);
								$("#fileinputDiv<?=$i;?>").hide();
								$("#imgDiv<?=$i;?>").show();
							}
						}
					});
					<? } ?>
				});
				</script>
			
				<div id="imgDiv1" class="imguploderDiv" style="display:none;">
					<img src="" id="imgpic1"/>
					<span onclick="showhide('fileinputDiv1','imgDiv1','1')">CANCEL X</span>
				</div>
				<div id="fileinputDiv1" class="imguploderDiv" style="background-image:url('<?=HTTP_SERVER;?>images/upload-photo.png');background-repeat:no-repeat;background-position: center center;height:140px;width:105px;">
				<span> Photo </span>
				<input id="pic1" name="pic1" type="file" class="img" />
				</div>
		</center><br/>
		
		</div>
		<div class="w3-col m4 w3-container">
		Mobile No.* :
			<input type="number" name="mobileno" id="mobileno" class="w3-input number masterTooltip" title="Enter your 10 digits mobile number." placeholder="10 digits Mobile number" maxlength="10" autocomplete="off" required/><div id="mobnoDiv"></div>
		Password* :<br/>
			<input type="password" name="ipassword" id="newpassword" placeholder="Password" maxlength="25" class="w3-input" required/>
		Full Name* :<br/>
		<input type="text" name="fullname" id="fullname" placeholder="Full Name"  maxlength="40" class="w3-input" required/></td>
		
		</div>
		<div class="w3-col m4 w3-container">
			
		Emailid :<br/>
		<input type="text" name="emailid" class="w3-input email" id="email" placeholder="Email id"/>
		Referal Code :<br/>
		<input type="text" name="refcode" class="w3-input" id="refcode" placeholder="Referal Code"/>
		
		<input type="hidden" name="token" value="<?=$token?>"/>
		<input type="submit" class="w3-btn w3-pink" id="submitbutton" value="Register"/> 
		<br/><br/><a href="login.php" class="link">Already registered? login here</a>
		<br/><br/>
		</div>		
	</div>
	</form>
</div>
<br/><br/>

	<? include "footer.php";?>
</body>
</html>