-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmsin.php
38 lines (25 loc) · 1005 Bytes
/
smsin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
$servername = "127.0.0.1"; // Change your own host of database
$username = "root"; // change your own root user of database
$password = "1"; // change your password of database
$dbname = "learn"; // name of your database
// Please make sure you create table SMSInbox in your database for which you provided credentials above
$to = $_REQUEST['to'];
$from = $_REQUEST['from'];
$text = $_REQUEST['text'];
$Ident = $_REQUEST['ident'];
$SMSRates = 1;
$current_date = date('m/d/Y h:i:s a', time());
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("insert into SMSInbox(DID,FromNumber,MSg,Date,OID,Ident,Rate) value (?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param('sssisii',$to, $from, $text, $current_date,$OID, $Ident, $SMSRates );
$stmt->execute();
echo "new record created successfully";
$stmt->close();
$conn->close();
?>