AIPT/cms_admin/db_connection.php

30 lines
862 B
PHP
Raw Permalink Normal View History

2024-10-29 11:42:53 +08:00
<?php
$servername = "107.155.87.31";
$username = "aitoolpath";
$password = "WBjexxZJfjzdxhid";
$database = "aitoolpath";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
function sanitize_input($input) {
// Remove unwanted characters and potential threats
$input = trim($input); // Remove unnecessary spaces
$input = stripslashes($input); // Remove backslashes
$input = htmlspecialchars($input); // Convert special characters to HTML entities
$input = preg_replace("/[\"'<>]/", "", $input); // Remove quotes and angle brackets
return $input;
}
error_reporting(0); // Disable all error reporting
ini_set('display_errors', 0); // Do not display errors on the page
?>