From 524fdc3a0ea3960823472e7e3f948b0cdd2003ef Mon Sep 17 00:00:00 2001 From: Mateja Date: Mon, 28 Sep 2020 19:25:40 +0200 Subject: checkboxes to array --- reservation.php | 74 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'reservation.php') diff --git a/reservation.php b/reservation.php index 84949c5..f070d1c 100644 --- a/reservation.php +++ b/reservation.php @@ -26,22 +26,22 @@ session_start();
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $stmt = $conn->prepare("INSERT INTO activities (name, surname, age) VALUES (:name, :surname, :age)"); - $stmt->bindParam(':name', $_POST['fname']); - $stmt->bindParam(':surname', $_POST['lname']); - $stmt->bindParam(':age', $_POST['age']); - $stmt->execute(); - echo "

Data inserted.

"; - } catch (PDOException $e) { - echo "

Error!: " . $e->getMessage() . "

"; - } + $user = "yota_user"; + $password = "leex3EThieK0ieLaiVaicaifef5eecei"; + $database = "yota_call_db"; + $table = "activities"; + try { + $conn = new PDO("mysql:host=localhost;dbname=$database", $user, $password); + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $stmt = $conn->prepare("INSERT INTO activities (name, surname, age) VALUES (:name, :surname, :age)"); + $stmt->bindParam(':name', $_POST['fname']); + $stmt->bindParam(':surname', $_POST['lname']); + $stmt->bindParam(':age', $_POST['age']); + $stmt->execute(); + echo "

Data inserted.

"; + } catch (PDOException $e) { + echo "

Error!: " . $e->getMessage() . "

"; + } } ?>
@@ -74,46 +74,46 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['fname']) && isset($_PO
I will be active on bands: - +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -121,25 +121,25 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['fname']) && isset($_PO
I will use modes: - +
- +
- +
- +
- +
- +
- +
-- cgit v1.2.3