-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
82 lines (55 loc) · 1.36 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
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
</head>
<body>
<div class="container main text-center" style="height: 500px ; margin-top: 100px; background: #DBE2D3" id="main">
<div class="up container col-12" id="up">
</div>
<div class="container" id="sub" style="background: white;height: 80px">
</div>
</div >
<div class="container">
<form action="" id="form">
<div class="form-group">
<input type="url" name="url" class="form-control container col-10" placeholder="Enter You Url" id="url" required>
<input type="submit" class="btn btn-outline-primary container" value="Go">
</div>
</form>
</div>
<script src="/jquery.js"></script>
<script>
$("#form").on("submit", function(){
let url = $("#url").val();
if(url.search("https://www.youtube.com/user") >= 0 || url.search("https://www.youtube.com/channel/") >=0){
setInterval(subscribe, 5000);
dataget();
}else{
alert("Only YouTube Channel URL");
}
return false;
});
function dataget(){
let link = $("#url").val();
$.ajax({
url: 'server.php',
type: 'get',
data: {url: link},
success: function(data){
$("#up").html(data);
//alert("success");
}
});
}
function subscribe(){
let link = $("#url").val();
$.ajax({
url: 'subserver.php',
type: 'get',
data: {url: link},
success: function(data){
$("#sub").html(data);
//alert("success");
}
});
}
</script>