Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php include './config/connection.php'; $message = ''; if(isset($_POST['login..

Decoded Output download

 
<?php  
	include './config/connection.php'; 
 
$message = ''; 
 
	if(isset($_POST['login'])) { 
    $userName = $_POST['user_name']; 
    $password = $_POST['password']; 
 
    $encryptedPassword = md5($password); 
 
    $query = "select `id`, `display_name`, `user_name`,  
`profile_picture` , `role` from `users`  
where `user_name` = '$userName' and  
`password` = '$encryptedPassword';"; 
 
try { 
  $stmtLogin = $con->prepare($query); 
  $stmtLogin->execute(); 
 
  $count = $stmtLogin->rowCount(); 
  if($count == 1) { 
    $row = $stmtLogin->fetch(PDO::FETCH_ASSOC); 
 
    $_SESSION['user_id'] = $row['id']; 
    $_SESSION['display_name'] = $row['display_name']; 
    $_SESSION['user_name'] = $row['user_name']; 
    $_SESSION['profile_picture'] = $row['profile_picture']; 
    $_SESSION['role'] = $row['role']; 
 
 
   
 
 
if($_SESSION['role']=='admin') 
{ 
 
   
    header("location:addis_dashboard_user.php"); 
    exit; 
} 
 
if($_SESSION['role']=='registrar') 
{ 
 
   
    header("location:addis_dashboard_registrar.php"); 
    exit; 
} 
 
 
if($_SESSION['role']=='reception') 
{ 
 
   
    header("location:addis_dashboard_reception.php"); 
    exit; 
} 
 
 
 
 
  } else { 
    $message = 'Incorrect username or password.'; 
  } 
}  catch(PDOException $ex) { 
      echo $ex->getTraceAsString(); 
      echo $ex->getMessage(); 
      exit; 
    } 
   
 
		 
	} 
?> 
 
 
 
<head> 
 
    <meta http-equiv="content type" content="text /html" charset="UTF 8"/> 
    <link rel="stylesheet" type="text/css" href="style.css"/> 
    <title>ART FASHION</title> 
  
</head> 
 
 
 
<body> 
 
<div class="navbar"><span></span> 
<div id="textdiv"> 
<h1>Art Fashion</h1> 
<p> 
 
</p> 
 
<!--<a   href="" class="button">find out more</a>--> 
 
 <!-- /.login-logo --> 
 
     
 <section class="container"> 
    <div class="login-container"> 
        <div class="circle circle-one"></div> 
        <div class="form-container"> 
 
            <h1 class="opacity"></h1> 
            <form method="post"> 
                <input type="text" placeholder="USERNAME" id="user_name" name="user_name" /> 
                <input type="password" placeholder="PASSWORD" id="password" name="password"/> 
                <button name="login" type="submit"  class="opacity">SUBMIT</button> 
            </form> 
            <div class="register-forget opacity"> 
                <a >     </a> 
                 
            </div> 
        </div> 
        <div class="circle circle-two"></div> 
    </div> 
    <div class="theme-btn-container"></div> 
</section> 
          <!-- /.col --> 
</div> 
 
 
<video id="videoid" poster="poster.png" autoplay muted loop> 
 
    <source src="model.mp4" type="video/mp4">  
    </video> 
 
</div> 
 
 
<script  src="./script.js"></script> 
 
</body>

Did this file decode correctly?

Original Code


<?php 
	include './config/connection.php';

$message = '';

	if(isset($_POST['login'])) {
    $userName = $_POST['user_name'];
    $password = $_POST['password'];

    $encryptedPassword = md5($password);

    $query = "select `id`, `display_name`, `user_name`, 
`profile_picture` , `role` from `users` 
where `user_name` = '$userName' and 
`password` = '$encryptedPassword';";

try {
  $stmtLogin = $con->prepare($query);
  $stmtLogin->execute();

  $count = $stmtLogin->rowCount();
  if($count == 1) {
    $row = $stmtLogin->fetch(PDO::FETCH_ASSOC);

    $_SESSION['user_id'] = $row['id'];
    $_SESSION['display_name'] = $row['display_name'];
    $_SESSION['user_name'] = $row['user_name'];
    $_SESSION['profile_picture'] = $row['profile_picture'];
    $_SESSION['role'] = $row['role'];


  


if($_SESSION['role']=='admin')
{

  
    header("location:addis_dashboard_user.php");
    exit;
}

if($_SESSION['role']=='registrar')
{

  
    header("location:addis_dashboard_registrar.php");
    exit;
}


if($_SESSION['role']=='reception')
{

  
    header("location:addis_dashboard_reception.php");
    exit;
}




  } else {
    $message = 'Incorrect username or password.';
  }
}  catch(PDOException $ex) {
      echo $ex->getTraceAsString();
      echo $ex->getMessage();
      exit;
    }
  

		
	}
?>



<head>

    <meta http-equiv="content type" content="text /html" charset="UTF 8"/>
    <link rel="stylesheet" type="text/css" href="style.css"/>
    <title>ART FASHION</title>
 
</head>



<body>

<div class="navbar"><span></span>
<div id="textdiv">
<h1>Art Fashion</h1>
<p>

</p>

<!--<a   href="" class="button">find out more</a>-->

 <!-- /.login-logo -->

    
 <section class="container">
    <div class="login-container">
        <div class="circle circle-one"></div>
        <div class="form-container">

            <h1 class="opacity"></h1>
            <form method="post">
                <input type="text" placeholder="USERNAME" id="user_name" name="user_name" />
                <input type="password" placeholder="PASSWORD" id="password" name="password"/>
                <button name="login" type="submit"  class="opacity">SUBMIT</button>
            </form>
            <div class="register-forget opacity">
                <a >     </a>
                
            </div>
        </div>
        <div class="circle circle-two"></div>
    </div>
    <div class="theme-btn-container"></div>
</section>
          <!-- /.col -->
</div>


<video id="videoid" poster="poster.png" autoplay muted loop>

    <source src="model.mp4" type="video/mp4"> 
    </video>

</div>


<script  src="./script.js"></script>

</body>

Function Calls

None

Variables

None

Stats

MD5 6bc4eff9bebbe7ae5db2effaaad1288e
Eval Count 0
Decode Time 57 ms