Skip to content

Commit

Permalink
push to database
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrturner committed Feb 26, 2024
1 parent ada4d01 commit 1a55a4c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions site/controllers/accessibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,37 @@

// valid data, send email
} else {
$host = 'localhost';
$username = 'atcomau1_ae24';
$password = 'kk6aGGh7GrRdmCU';
$database = 'atcomau1_audible_edge_2024';
$table = "accessibility_requests";

$conn = mysqli_connect($host, $username, $password, $database);

// Check connection
if ($conn === false) {
die("Error: could not connect. " . mysqli_connect_error());
}


// Prepare and bind
$stmt = $conn->prepare("INSERT INTO $table (name, pronouns, email, phone, text) VALUES (?, ?, ?, ?, ?)");
$stmt->bind_param("sssss", $data['name'], $data['pronouns'], $data['email'], $data['phone'], $data['text']);


// $sql = "INSERT INTO $table (name, phone, date_added) VALUES ('$name', '$number', '$dateAdded');";

// if (mysqli_query($conn, $sql)) {
// echo '<div class="form-container"><p class="form-text">Records successfully added!</p><p class="form-text">Welcome to the Audible Edge text line.</p></div>';
// } else {
// echo '<div class="form-container"><p class="form-text">ERROR: Unable to execute $sql.</p></div>' . mysqli_error($conn);
// }

// $stmt->close();
// $conn->close();
mysqli_close($conn);

try {
$kirby->email([
'template' => 'email',
Expand Down

0 comments on commit 1a55a4c

Please sign in to comment.