Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions api/46elks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

require_once ("../includes/config.php");

//Token for security shit.. so filip doesnt spam me
//$token = $_GET['token'];

//Sent from number
$sentfrom = $_POST['from'];

//Type of message
$type = "text";

//Text message
$message = $_POST['message'];

//Number text message is being sent to
$sentto = $_POST['to'];

//Date which this shit is recived (dont use.. use timestamp in DB)
$receivedate = date("Y-m-d H:i:s");

if (!empty($message)) {
/* Insert incoming messages */
$sql = "INSERT INTO messages (type, sentfrom, sentto, message) VALUES('".$type."', '".$sentfrom."', '".$sentto."', '".$message."') ";
}

if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error " . $sql . "<br>" . $conn->error;
}
32 changes: 32 additions & 0 deletions api/twilio.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

require_once ("../includes/config.php");

//Token for security shit.. so filip doesnt spam me
$token = $_GET['token'];

//Sent from number
$sentfrom = $_POST['From'];

//Type of message
$type = "text";

//Text message
$message = $_POST['Body'];

//Number text message is being sent to
$sentto = $_POST['To'];

//Date which this shit is recived (dont use.. use timestamp in DB)
$receivedate = date("Y-m-d H:i:s");

if (!empty($message)) {
/* Insert incoming messages */
$sql = "INSERT INTO messages (type, sentfrom, sentto, message) VALUES('".$type."', '".$sentfrom."', '".$sentto."', '".$message."') ";
}

if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error " . $sql . "<br>" . $conn->error;
}