/
home
/
efamember
/
domains
/
efa-member.com
/
public_html
/
curl_receiver
/
up file
home
<?php session_start(); include('../config/main_function.php'); $secure = "cAh3DrJACzw4RbU"; $connection = connectDB($secure); if ($connection) { // $dbhost = "localhost"; // $dbuser = "efamember_j9ckhwosk"; // $dbpass = "ISA4ZSvtx"; // $dbname = "efamember_k8hk2odkl"; // $mysqli = new mysqli($dbhost, $dbuser, $dbpass, $dbname); // if ($mysqli->connect_error) { // die("Connection failed: " . $mysqli->connect_error); // } //// debug connection // else { // echo "Connect success"; // } $law_id = getRandomID(10, 'tbl_law', 'law_id');; $name = "file"; $file_path = 'D/ddd'; $stmt = $connection->prepare("INSERT INTO tbl_law (law_id, law_description, law_title) VALUES (?, ?, ?)"); //// debug prepare if (!$stmt) { die("Prepare failed: (" . $connection->errno . ") " . $connection->error); } //// s = string , i = int. $stmt->bind_param("sss", $law_id, $name, $file_path); // Change to "iss" if law_id is an integer if ($stmt->execute()) { echo "200"; } else { echo "Error: " . $stmt->error; } $stmt->close(); $mysqli->close(); }