KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/abtechsci/mmc15/ezupload/cp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/abtechsci/mmc15/ezupload/cp/user_register.php
<?php
//error_reporting(E_ERROR  | E_PARSE);
$page_errors = array();

require("db.class.php");

$first_name=$_POST["first_name"];
$last_name=$_POST["last_name"];
$name=$_POST["name"];
$email=$_POST["email"];
$pass=$_POST["pass"];
$confirm_pass=$_POST["confirm_pass"];
$submit = $_POST["submit"];

//get header and footer
$customize=new customize();
$temp=$customize->get();
$header=$temp[0]->header;
$footer=$temp[0]->footer;


if($submit != "" )
{
		//check allowed domains
		$form_settings =  new form_setting();
		$ar = $form_settings->get();
		$public_reg = $ar[0]->public_reg;
		
		$setting=new settings();
		$temp=$setting->get();
		$admin_email=$temp[0]->adminemail;
		$base_folder = $temp[0]->base_folder;
		$site_name = $temp[0]->site_name;				
		
		if($public_reg!=1){
			$page_errors[] = "Registeration is not allowed!";
		}
		if(empty($first_name)){
			$page_errors[] = "Please enter first name.";										
		}
		if(empty($last_name)){
			$page_errors[] = "Please enter last name.";				
		}
		if(empty($name)){
			$page_errors[] = "Please enter username.";				
		}
		if(empty($email)){
			$page_errors[] = "Please enter your email.";				
		}
		if(empty($pass)){
			$page_errors[] = "Please enter password.";				
		}
		if(strcmp($pass,$confirm_pass)!=0){
			$page_errors[] = "Password and confirm password are not identical.";							
		}
		if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email))	{
			$page_errors[] = "Invalid email address.";									
		}
		
		//check username and email for existence
		if(count($page_errors)<=0)
		{	
			$user=new user();
			$temp=$user->check_existence($name);
			if(!empty($temp)){
				$page_errors[] = "Username is already exist.";													
			}
			
			$temp=$user->check_email_existence($email);
			if(!empty($temp)){
				$page_errors[] = "Email is already exist.";													
			}						
		}
		
		//save data and send emails if everything is okay
		if(count($page_errors)<=0)
		{		
				$code =substr_replace(rand().time().time().rand(),'',0,20); 			
				$user->insert( $name, $email, $pass,$first_name,$last_name,$code,0);
				$headers = "From: $site_name<$admin_email>\r\n";
				$headers .= "Reply-To: $site_name<$admin_email>\r\n";
				$headers .= "Return-Path: $site_name<$admin_email>\r\n";				
				
				$message = "Thank you for registering with $site_name\r\n\r\r";
				$message .= "To activate your account, please click the following link or copy and paste it into your browser\r\n";				
				$message .= "$base_folder/cp/activate.php?email=$email&code=$code\r\n";
				mail($email,"Verification Code",$message,$headers);				
				header("location: welcome.php");
		}
}

function print_errors()
{
	global $page_errors;
	
	echo "<div class=error>";
	foreach($page_errors as $key=>$val)
	{
		echo "&nbsp; * $val" . "<br>";
	}
	echo "</div>";
}

?>
<HTML>
<HEAD><TITLE>Create New Account</TITLE>
<link href="f_files/login.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY>
<?php echo $header;?><br>
<TABLE cellSpacing=0 cellPadding=0  width="100%" border=0>
<TBODY>
	
	<TR class=header>
	  <TD colSpan=2 align="center">&nbsp;</TD>
    </TR>
	<TR class=header> <TD colSpan=2 align="center"><FORM method=POST action=<?php echo $_SERVER['PHP_SELF']?>>
	  <table border="1" cellpadding="0" cellspacing="0" width="377" id="table1" height="290" bordercolor="#000066">
  <tr>
    <td width="373" height="23" align="center" bgcolor="#7895C9"><strong><font color="#FFFFFF">Create New Account </font></strong></td>
  </tr>
    
  <tr>
    <td height="265" valign="top" bgcolor="#DEEDFE"> 
	<?php print_errors(); ?>
      <TABLE height="229"  border=0 align="center" cellPadding=2 cellSpacing=1 class=formtbl>
        <TBODY>
          
          <TR class=altsecond>
            <TD width="101" height="23" vAlign=top>&nbsp;</TD>
            <TD width="146">&nbsp;</TD>
          </TR>
          <TR class=altsecond>
            <TD height="26" vAlign=middle><B>First Name </B><BR>            </TD>
            <TD><input name=first_name type=text id="first_name" value= '<?php echo $first_name ;  ?>' size="18" maxlength="40"  ></TD>
          </TR>
          <TR class=altsecond>
            <TD height="26" vAlign=middle><strong>Last Name </strong><BR>            </TD>
            <TD><input name=last_name type=text id="last_name" value= '<?php echo $last_name;  ?>' size="18" maxlength="40"  ></TD>
          </TR>
          <TR class=altsecond>
            <TD height="26" vAlign=middle><strong>Username</strong><BR>            </TD>
            <TD><input name=name type=text id="name" value= '<?php echo $name;  ?>' size="18" maxlength="40"  ></TD>
          </TR>
          <TR class=altsecond>
            <TD height="26" vAlign=middle><B>Email</B><BR>            </TD>
                <TD><input name=email type=text id="email" value= '<?php echo $email ;  ?>' size="18" maxlength="40"  ></TD>
              </TR>
          <TR class=altfirst>
            <TD height="26" vAlign=middle><B>Password</B><BR>            </TD>
                <TD valign="top"><input name=pass type=password value='<?php echo $pass ; ?>' size="20" maxlength="40" ></TD>
              </TR>
          <TR class=altfirst>
            <TD height="26" vAlign=middle><B>Confirm Password</B></TD>
            <TD valign="top"><input name=confirm_pass type=password id="confirm_pass" value= '<?php echo $confirm_pass ;  ?>' size="20" maxlength="40"  ></TD>
          </TR>
          <TR class=header align=middle>
            <TD height="41" colspan="2" align="center"><input name=submit type=submit id="submit" value= 'Create Account'></TD>
            </TR>
          </TBODY>
      </TABLE>      </td>
  </tr>
</table>
    </FORM></TD>
	</TR>
	<TR class=header>
	  <TD colSpan=2 align="center">&nbsp;</TD>
    </TR>
</TBODY>
</TABLE>
<br>
<?php echo $footer;?>
</BODY></HTML>


Anon7 - 2021