-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscroll.php
More file actions
45 lines (31 loc) · 1.46 KB
/
Copy pathscroll.php
File metadata and controls
45 lines (31 loc) · 1.46 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
40
41
42
43
44
45
<?php
include ('connect.php');
// Create table
$scroll_height = $_POST['scroll'];
$ip_address = $_SERVER["REMOTE_ADDR"];
$t_query1="SELECT * FROM user_scroll where ip='$ip_address'";
$runs1 = mysqli_query($con,$t_query1);
if ($row=mysqli_fetch_assoc($runs1))
{
if($row['scroll']<$scroll_height)
{
$id= $row['id'];
$t_query="UPDATE user_scroll SET scroll='$scroll_height' where id='$id' and ip='$ip_address'";
$runs = mysqli_query($con,$t_query);
if(!$runs)
{
echo "not registered";
}
}
}
else
{
$t_query="INSERT INTO user_scroll (ip,scroll) VALUES ('$ip_address','$scroll_height')";
$runs = mysqli_query($con,$t_query);
if(!$runs)
{
echo "not registered";
}
}
?>
<h3 style="display: none;" id="none1">Done</h3>