How to take the name of the picture from the form and upload the picture to another file
$servername = 'localhost'; $username = 'root'; $password = ''; $dbname = 'shop'; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $name = ($_GET['name']); $description = ($_GET['description']); $price = ($_GET['price']); $category = ($_GET['category']); if ($stmt = $conn->prepare("INSERT INTO products (name, description, price, category) VALUES (?, ?, ?, ?)")) { // Bind the variables to the parameter as strings. $stmt->bind_param("ssss", $name, $description, $price, $category); // Execute the statement. $stmt->execute(); // Close the prepared statement. $stmt->close(); echo "ok"; } ?>