Online Pharmacy Management System Project In Php Info

?> <?php require_once 'includes/config.php'; if ($_SERVER['REQUEST_METHOD'] == 'POST') $name = $_POST['name']; $email = $_POST['email']; $password = password_hash($_POST['password'], PASSWORD_DEFAULT); $phone = $_POST['phone'];

else // Logged-in user: store in database $user_id = $_SESSION['user_id']; $medicine_id = $_POST['medicine_id']; $quantity = $_POST['quantity']; online pharmacy management system project in php

if ($has_prescription_required && isset($ FILES['prescription'])) $target_dir = "uploads/prescriptions/"; $prescription_path = $target_dir . time() . " " . basename($_FILES['prescription']['name']); move_uploaded_file($_FILES['prescription']['tmp_name'], $prescription_path); ?php require_once 'includes/config.php'

$sql = "INSERT INTO users (name, email, password, phone) VALUES (?, ?, ?, ?)"; $stmt = $pdo->prepare($sql); $email = $_POST['email']

$sql = "INSERT INTO cart (user_id, medicine_id, quantity) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE quantity = quantity + ?"; $stmt = $pdo->prepare($sql); $stmt->execute([$user_id, $medicine_id, $quantity, $quantity]);

$user_id = $_SESSION['user_id']; $prescription_path = null;