Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<!DOCTYPE html> <html lang="en"> <head> <script src="https://code.jquery.com/jquery-3.7..
Decoded Output download
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
</style>
</head>
<body>
<form action="" method="post">
<input type="text" id="search" placeholder="Search...">
<div id="results">h</div>
</form>
<?php
// Create a database connection
$conn = mysqli_connect("localhost","root","","dr_maths");
// Check the connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_POST['query'])) {
$query = $_POST['query'];
// Perform a database query to search for results based on the user's input
$sql = "SELECT user_name FROM users WHERE user_name LIKE '%$query%'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// Display a "true mark" sign (e.g., checkmark)
echo ""; // This will display a checkmark
} else {
// You can optionally display something else for "no results found"
echo "";
}
}
// Close the database connection
$conn->close();
?>
<script>
$(document).ready(function() {
$('#search').keyup(function() {
var query = $(this).val();
if (query.length >= 2) { // Adjust the minimum characters to trigger the search
$.ajax({
url: 'test.php',
method: 'POST',
data: { query: query },
success: function(data) {
// Display the "true mark" sign in #results
$('#results').html(data);
}
});
} else {
// Clear the results if the input is too short
$('#results').html('');
}
});
});
</script>
</body>
</html>
Did this file decode correctly?
Original Code
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
</style>
</head>
<body>
<form action="" method="post">
<input type="text" id="search" placeholder="Search...">
<div id="results">h</div>
</form>
<?php
// Create a database connection
$conn = mysqli_connect("localhost","root","","dr_maths");
// Check the connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_POST['query'])) {
$query = $_POST['query'];
// Perform a database query to search for results based on the user's input
$sql = "SELECT user_name FROM users WHERE user_name LIKE '%$query%'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// Display a "true mark" sign (e.g., checkmark)
echo ""; // This will display a checkmark
} else {
// You can optionally display something else for "no results found"
echo "";
}
}
// Close the database connection
$conn->close();
?>
<script>
$(document).ready(function() {
$('#search').keyup(function() {
var query = $(this).val();
if (query.length >= 2) { // Adjust the minimum characters to trigger the search
$.ajax({
url: 'test.php',
method: 'POST',
data: { query: query },
success: function(data) {
// Display the "true mark" sign in #results
$('#results').html(data);
}
});
} else {
// Clear the results if the input is too short
$('#results').html('');
}
});
});
</script>
</body>
</html>
Function Calls
mysqli_connect | 1 |
Stats
MD5 | f24808e456249988d3bbdb5f3b18f682 |
Eval Count | 0 |
Decode Time | 56 ms |