D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
kk.encodersunlimited.com
/
Filename :
config.php
back
Copy
<?php // Ensure the session is started if (!isset($_SESSION)) { session_start(); } $server = 'localhost'; $user = 'encodto1_kk'; $database = 'encodto1_kk'; $password = 'KK@20242024'; // Establish the database connection $conn = mysqli_connect($server, $user, $password, $database); // Check for connection errors if (mysqli_connect_errno()) { die("Can't connect to the database: " . mysqli_connect_error()); } // Define upload source constants if not already defined if (!defined('UPLOAD_SRC')) { define("UPLOAD_SRC", $_SERVER['DOCUMENT_ROOT']."/uploads/"); } if (!defined('FETCH_SRC')) { define("FETCH_SRC", "http://127.0.0.1/"); } // Check if the function is already defined before declaring it if (!function_exists('image_upload')) { function image_upload($img) { if ($img['error'] !== UPLOAD_ERR_OK) { header("Location: index.php?alert=img_upload_error&code=" . $img['error']); exit; } $tmp_loc = $img['tmp_name']; $new_name = random_int(11111, 99999) . basename($img['name']); $new_loc = UPLOAD_SRC . $new_name; if (!is_dir(UPLOAD_SRC) || !is_writable(UPLOAD_SRC)) { header("Location: index.php?alert=upload_dir_error"); exit; } if (!move_uploaded_file($tmp_loc, $new_loc)) { header("Location: index.php?alert=img_upload_failed"); exit; } return $new_name; } } $company ="Maa Tara Films"; ?>