Welcome to The Project Contacts

Contacts

connect_error) { die("Connection failed: " . $conn->connect_error); } $imagePath = null; if (isset($_FILES['picture']) && $_FILES['picture']['error'] === UPLOAD_ERR_OK) { $uploadDir = 'uploads/'; if (!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); } $imagePath = $uploadDir . basename($_FILES['picture']['name']); move_uploaded_file($_FILES['picture']['tmp_name'], $imagePath); } $sql = "INSERT INTO users (username, fullname, email, phone, country, hobbies, skills, education, picture) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);"; $stmt = $conn->prepare($sql); $stmt->bind_param("sssssssss", $_POST['username'], $_POST['fullname'], $_POST['email'], $_POST['phone'], $_POST['country'], $_POST['hobbies'], $_POST['skills'], $_POST['education'], $imagePath); if ($stmt->execute()) { echo "Data saved successfully!"; } else { echo "Error: " . $stmt->error; } $stmt->close(); $conn->close(); } ?>