Skip to content

Instantly share code, notes, and snippets.

@myhexa

myhexa/endpoint-example.php Secret

Last active May 24, 2020
Embed
What would you like to do?
Example endpoint integration for Campfire
<?php
if(isset($_POST["campaign")) {
// Create connection
$conn = mysqli_connect("localhost, "DB_USER", "DB_PASSWORD", "DB_NAME); // Replace these variables
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
$sql = "INSERT INTO MyTable (campaignID, rate, email, message)
VALUES ('$_POST[campaignId]', '$_POST[rate]', '$_POST[email]', '$_POST[message]')";
// If data inserted successfully...
if (mysqli_query($conn, $sql)) {
echo "Success, your feedback was submitted. Thank you!";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
}
?>
@myhexa

This comment has been minimized.

Copy link
Owner Author

@myhexa myhexa commented May 24, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.