-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfrontlinesms_admin.php
More file actions
37 lines (29 loc) · 970 Bytes
/
frontlinesms_admin.php
File metadata and controls
37 lines (29 loc) · 970 Bytes
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
<?php
function generateRandomString($length)
{
$result = '';
$num = rand(0,26);
$result .= substr(md5(microtime()),$num,$length);
return $result;
}
function check_frontlinesms_key()
{
global $wpdb;
$table = $wpdb->prefix."frontlinesms";
$frontlinesms_key = $wpdb->get_var($wpdb->prepare("SELECT FRONTLINE_key FROM $table"));
if(!isset($frontlinesms_key)){
$frontlinesms_key = generateRandomString(8);
$send = "INSERT INTO $table(FRONTLINE_key) VALUES('$frontlinesms_key')";
$wpdb->query($send);
return $frontlinesms_key;
}else{
return $frontlinesms_key;
}
}
?>
<br />
<?
echo "<b> http://" . $_SERVER['HTTP_HOST'] . "/index.php?ss=\${sender_number}&mm=\${message_content}&kk=</b>";
echo "<b>" . check_frontlinesms_key() . "</b><br />";
echo "Just fill the link above to the frontlineSMS external command Http Request";
?>