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 if(isset($_GET['Id'])){ $f_id = $_GET['Id']; $query = $pdo->prepare("sele..
Decoded Output download
<?php
if(isset($_GET['Id'])){
$f_id = $_GET['Id'];
$query = $pdo->prepare("select * from aptech where Id = :id");
$query->bindParam('Id',$f_id);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
// print_r($res);
}
?>
<div class="container mt-5">
<form action="" method="post">
<div class="form-group">
<label for="">Name</label>
<input type="text" name="name" value="<?php echo $result['name']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Email</label>
<input type="text" name="email" value="<?php echo $result['email']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">City</label>
<input type="text" name="city" value="<?php echo $result['city']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Department</label>
<input type="text" name="department" value="<?php echo $result['department']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Salary</label>
<input type="text" name="salary" value="<?php echo $result['salary']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Subject</label>
<select class="form-control" name="sub_id" id="">
<option>Select Subject</option>
<?php
$query = $pdo->query("select * from content");
$result = $query->fetchAll(PDO::FETCH_ASSOC);
foreach($result as $sub){
?>
<option value="<?php echo $sub['Sub_id']?>"><?php echo $sub['Sub_name']?></option>
</div>
<?php
}
?>
</select>
</div>
<button type="submit" class="btn btn-info" name="update">Update</button>
</form>
</div>
<?php
if(isset($_POST['update'])){
$name = $_POST['name'];
$email = $_POST['email'];
$city = $_POST['city'];
$department = $_POST['department'];
$salary = $_POST['salary'];
$sub_id = $_POST['sub_id'];
$query = $pdo->prepare("update employee set name = :name , email = :email , city = :city , department = :dept, salary = :salary ,
subject_id = :sub_id where id = :id");
$query->bindParam('name', $name);
$query->bindParam('email', $email);
$query->bindParam('city', $city);
$query->bindParam('department', $department);
$query->bindParam('salary', $salary);
$query->bindParam('sub_id', $sub_id);
$query->bindParam('id', $f_id);
$query->execute();
echo "<script>alert('updated successfully')</script>";
}
?>
Did this file decode correctly?
Original Code
<?php
if(isset($_GET['Id'])){
$f_id = $_GET['Id'];
$query = $pdo->prepare("select * from aptech where Id = :id");
$query->bindParam('Id',$f_id);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
// print_r($res);
}
?>
<div class="container mt-5">
<form action="" method="post">
<div class="form-group">
<label for="">Name</label>
<input type="text" name="name" value="<?php echo $result['name']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Email</label>
<input type="text" name="email" value="<?php echo $result['email']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">City</label>
<input type="text" name="city" value="<?php echo $result['city']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Department</label>
<input type="text" name="department" value="<?php echo $result['department']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Salary</label>
<input type="text" name="salary" value="<?php echo $result['salary']?>" id="" class="form-control" placeholder=""
aria-describedby="helpId">
</div>
<div class="form-group">
<label for="">Subject</label>
<select class="form-control" name="sub_id" id="">
<option>Select Subject</option>
<?php
$query = $pdo->query("select * from content");
$result = $query->fetchAll(PDO::FETCH_ASSOC);
foreach($result as $sub){
?>
<option value="<?php echo $sub['Sub_id']?>"><?php echo $sub['Sub_name']?></option>
</div>
<?php
}
?>
</select>
</div>
<button type="submit" class="btn btn-info" name="update">Update</button>
</form>
</div>
<?php
if(isset($_POST['update'])){
$name = $_POST['name'];
$email = $_POST['email'];
$city = $_POST['city'];
$department = $_POST['department'];
$salary = $_POST['salary'];
$sub_id = $_POST['sub_id'];
$query = $pdo->prepare("update employee set name = :name , email = :email , city = :city , department = :dept, salary = :salary ,
subject_id = :sub_id where id = :id");
$query->bindParam('name', $name);
$query->bindParam('email', $email);
$query->bindParam('city', $city);
$query->bindParam('department', $department);
$query->bindParam('salary', $salary);
$query->bindParam('sub_id', $sub_id);
$query->bindParam('id', $f_id);
$query->execute();
echo "<script>alert('updated successfully')</script>";
}
?>
Function Calls
None |
Stats
MD5 | 943f47a4194cfd2f10da50d58f4135fd |
Eval Count | 0 |
Decode Time | 54 ms |