-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.php
107 lines (97 loc) · 4.72 KB
/
index.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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<title>Send Sms</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="generator" content="Bootply" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="asset/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="container">
<h2>Send SMS via way2sms<small>created by Aashutosh</small></h2>
<form method="post" class="form form-horizontal" name="sendsms" id="sendsms">
<div class="row">
<div class="form-group">
<label for="usrname" class="col-md-3 col-sm-4 col-xs-12">User Name</label>
<div class=" col-sm-9 col-sm-8 col-xs-12 ">
<input class="form-control form-textbox" name="usrname" required="" type="text" value="" placeholder="way2sms username..">
</div>
</div>
<div class="form-group">
<label for="pwd" class="col-md-3 col-sm-4 col-xs-12">Password</label>
<div class=" col-sm-9 col-sm-8 col-xs-12 ">
<input class="form-control form-textbox" name="pwd" required="" type="password" value="" placeholder="way2sms password..">
</div>
</div>
<div class="form-group">
<label for="recipient" class="col-md-3 col-sm-4 col-xs-12">Recipient </label>
<div class=" col-sm-9 col-sm-8 col-xs-12 ">
<input class="form-control form-textbox" name="recipient" required="" value="" placeholder="recipient like 7398346600,7398346600,...">
</div>
</div>
<div class="form-group">
<label for="msg" class="col-md-3 col-sm-4 col-xs-12">message</label>
<div class=" col-sm-9 col-sm-8 col-xs-12 ">
<textarea type="text" class="form-control" name="msg" required="" placeholder="Enter msg here. like hello Anju how are u!!"></textarea>
</div>
</div>
<br>
<div class="row text-center">
<button class="btn btn-primary btn-lg">Send message</button>
</div>
</div>
<div style="margin-top: 4%"></div>
<div class="jumbotron">
<ul id="result" class="text-success list-unstyled">
</ul>
</div>
</form>
</div>
</div>
<script src="asset/jquery.min.js"></script>
<script src="asset/bootstrap.min.js"></script>
<script>
$("#sendsms").submit(function(){
$("button").addClass("disabled");
var last_response_len = false;
$.ajax('proxy.php?'+$("#sendsms").serialize(), {
xhrFields: {
onprogress: function (e)
{
var this_response, response = e.currentTarget.response;
if (last_response_len === false)
{
this_response = response;
last_response_len = response.length;
}
else
{
this_response = response.substring(last_response_len);
last_response_len = response.length;
}
$("#result").append('<li>' + this_response + '</li>');
}
}
})
.done(function (data)
{
$("#result").append("<li>completed</li>");
$("button").removeClass("disabled");
})
.fail(function (data)
{
$("#result").append("<li>Failed to get</li>");
$("button").removeClass("disabled");
});
$("#result").append("<li>start sending..</li>");
return false;
});
</script>
</body>
</html>