/
featuredadclicks3.php
72 lines (72 loc) · 1.76 KB
/
featuredadclicks3.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
<?
session_start();
include "config.php";
$id = $_GET['id'];
$query = "select * from featuredads where id = '".$id."' LIMIT 1";
$result = mysql_query ($query) or die (mysql_error());
$numrows = @ mysql_num_rows($result);
?>
<html>
<body>
<?
if($_GET['url'])
{
?>
<div style="float: left; padding-top: 75px;">
<a href="<? echo $_GET['url']; ?>" target="_top">Remove This Frame</a>
</div>
<div style="float: right; padding-top: 75px;">
<a href="<? echo $_GET['url']; ?>" target="_top">Remove This Frame</a>
</div>
<?
}
?>
<center>
<?
if ($numrows == 1)
{
$query1 = "select * from featuredadclicks where userid='".$userid."' and featuredadid=".$id;
$result1 = mysql_query($query1) or die (mysql_error());
$numrows1 = @ mysql_num_rows($result1);
$query3 = "select * from members where userid='".$userid."'";
$result3 = mysql_query($query3) or die (mysql_error());
$userrecord = mysql_fetch_array($result3);
$memtype = $userrecord["memtype"];
if ($numrows1 == 0)
{
if ($memtype == "SUPER JV")
{
$earn = $superjvfeaturedadearn;
}
if ($memtype == "JV Member")
{
$earn = $jvfeaturedadearn;
}
if (($memtype != "SUPER JV") and ($memtype != "JV Member"))
{
$earn = $profeaturedadearn;
}
$queryaddpoints="update members set points=points+".$earn." where userid='".$userid."'";
$resultaddpoints=mysql_query($queryaddpoints);
echo "<font color=BLACK>You have earned <font color=RED><b>$earn</b></font> points</font>. ";
$query2 = "insert into featuredadclicks set userid='".$userid."', dateviewed=NOW(), featuredadid=".$id;
$result2 = mysql_query ($query2) or die (mysql_error());
} # if ($numrows1 == 0)
else
{
echo "You have already received points for this link";
}
} # if ($numrows == 1)
else
{
echo "Invalid link";
}
?>
<br>
<?
include("banners.php");
mysql_close();
?>
</center>
</body>
</html>