-
Notifications
You must be signed in to change notification settings - Fork 0
/
loggedinproc.html
79 lines (65 loc) · 2.84 KB
/
loggedinproc.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?
session_start();
$uid = $_SESSION['uid'];
$defaultmodel = $_REQUEST['modelfield'];
$devicephonenumberfield = $_REQUEST['devicephonenumberfield'];
$hosturlfield = $_REQUEST['hosturlfield'];
$dbname = "cloudify";
$dbhostname="db02.transactionalweb.net";
$dblogin = "cloudify";
$dbpassword="cloudify";
if( !($dbLink = mysql_connect($dbhostname, $dblogin, $dbpassword))) {
print("Failed phase1 to connect to server!\n");
print("Request Aborted!\n");
exit();
}
if( ! mysql_select_db($dbname, $dbLink) ) {
print("Failed phase2 to connect to database on server!<BR>\n");
print("Request Aborted!\n");
exit();
}
$q = "select * from users where ";
$q .= " uid='" . $uid. "' ;";
$dbr = mysql_query($q,$dbLink);
$n = mysql_num_rows($dbr);
if($n > 0){
$nowtime = time();
$sessionkey = mt_rand();
//print "sessionkey=$sessionkey";
$q2 = "UPDATE users set ";
//$q2 .= " defaultmodel='" . addslashes(trim($defaultmodel)) . "', ";
$q2 .= " defaulturl='" . addslashes(trim($hosturlfield)) . "', ";
$q2 .= " weburl='" . addslashes(trim($weburlfield)) . "', ";
$q2 .= " msisdn='" . addslashes(trim($devicephonenumberfield)) . "', ";
$q2 .= " smstime = '" . $nowtime . "', ";
$q2 .= " sessionkey='" . $sessionkey . "' ";
$q2 .= " WHERE uid='" . $uid . "';";
//print "q2=$q2";
$smsaddress = trim($devicephonenumberfield) . "@txt.att.net";
//$smscontent = $hosturlfield . "?model=" . base64_encode(trim($defaultmodel)) ;
//$smscontent = "https://transactionalweb.com/cloud/configfile.html?s=" . $sessionkey . "&u=" . $uid;
$smscontent = "STR https://transactionalweb.com/cloud/configfile.html?s=" . $sessionkey . "&u=" . $uid . " STE";
mysql_query($q2);
$smssubject = date("Y-m-d") . 'T' . date("H:i:s") .'+00:00';
$message = "<br><b>Message Sent To:<br></b>" . $smsaddress;
$message .= "<br><b>Subject: <br></b>" ;
$message .= date("Y-m-d") . 'T' . date("H:i:s") .'+00:00';
$message .= "<br><b>Content: <br></b>" ;
$message .= $smscontent;
require("class.phpmailer.php");
$fromemail = '[email protected]';
$fromname = 'TransActionalWeb.Com';
$mail = new PHPMailer();
$mail->From = $fromemail;
$mail->FromName = $fromname;
$mail->AddAddress(trim($smsaddress), "");
$mail->IsHTML(false);
$mail->Subject = $smssubject;
$mail->Body = $smscontent;
$mail->Send();
header("Location: index.html?m=" . base64_encode($message) );
}else{
$message = base64_encode("Not Done.");
header("Location: index.html?m=" . $message );
}
?>