-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
39 lines (36 loc) · 1.15 KB
/
index.php
File metadata and controls
39 lines (36 loc) · 1.15 KB
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
<?php include 'inc/code.php'; ?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>iP and Country Code</title>
<link rel="stylesheet" href="inc/style.css">
<link rel='stylesheet' href='https://getbootstrap.com/docs/4.0/dist/css/bootstrap.min.css'>
</head>
<body>
<div class="">
<div class="d-flex align-items-center justify-content-center" style="padding-top:25%;">
<?php foreach ($countrycode as $key=>$item): ?>
<?php if ($key == $country): ?>
<input class="phone" id="phone" name="phone" type="tel" class="form-control" value="+ <?php echo $item; ?> ">
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<script src='inc/jquery.js'></script>
<script src='inc/phone.js'></script>
<script>
var input = document.querySelector("#phone");
window.intlTelInput(input, {
initialCountry: "tr" });
$(document).ready(function () {
$('.iti__flag-container').click(function () {
var countryCode = $('.iti__selected-flag').attr('title');
var countryCode = countryCode.replace(/[^0-9]/g, '');
$('#phone').val("");
$('#phone').val("+" + countryCode + " " + $('#phone').val());
});
});
</script>
</body>
</html>