I have a Paid To Click site and currently the links are only clickable one time... period. I want members to be able to click them one time each day, but I am completely at a loss of how to do this.
Secondly, I am wondering if anybody knows how to make a timer countdown. For instance, when a member clicks on an advertisement right now, it simply shows: "You will be credited in 30 seconds." I would like for it to show: "You will be credited in 30...29...28" etc so they know exactly how long until they are credited. I will post some code from the files I believe you would use, but I am not 100% sure. If anybody knows any fixes for this, I would greatly appreciate it.
Also, the website I am talking about is here:
http://www.onlinecashclicks.com - If you want to sign up to see what I am talking about, feel free. Thanks again in advance.
Also, I know this code is horribly written, but being as I am horrible as well, I do not know how to fix it (this is someone else's script).
frame.php
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title><link type="text/css" rel="stylesheet" href="css/style.css" />
</head>
<?
include('includes/data_conn.php');
$get_general = mysql_query("SElECT * FROM main");
$grow = mysql_fetch_array($get_general);
$g_genid = $grow[genid];
$g_title = $grow[title];
$g_baseurl = $grow[baseurl];
$g_rooturl = $grow[rooturl];
$g_aemail = $grow[adminemail];
$g_pemail = $grow[paypalemail];
$g_lcharge = $grow[linkcharge];
$g_bcharge = $grow[bannercharge];
$g_withdraw = $grow[withdraw];
$g_bold = $grow[bold];
$g_italic = $grow[italic];
$g_referral = $grow[referral];
?>
<frameset rows="80,*" frameborder="no" border="0" framespacing="0">
<frame src="timer.php?adid=<?=$adid;?>&time=<?=$time;?>" name="top" scrolling="no" noresize="noresize" />
<frame src="http://<?=$url;?>" name="main" />
</frameset><noframes></noframes>
<body>
</body>
</html>
timer.php
PHP Code:
<? session_start(); ?>
<? include('includes/data_conn.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title><? echo $g_title ?></title>
<link type="text/css" rel="stylesheet" href="fix/css/style.css" />
<?
include('includes/data_conn.php');
$get_general = mysql_query("SElECT * FROM main");
$grow = mysql_fetch_array($get_general);
$g_genid = $grow[genid];
$g_title = $grow[title];
$g_baseurl = $grow[baseurl];
$g_rooturl = $grow[rooturl];
$g_aemail = $grow[adminemail];
$g_pemail = $grow[paypalemail];
$g_lcharge = $grow[linkcharge];
$g_bcharge = $grow[bannercharge];
$g_withdraw = $grow[withdraw];
$g_bold = $grow[bold];
$g_italic = $grow[italic];
$g_referral = $grow[referral];
?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
td {
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
}
-->
</style>
</head>
<body bgcolor="#000000" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="bgblu" width="5%" align="left" valign="middle" height="80"></td>
<td class="bgblu" width="46%" align="left" valign="middle" height="80"><font color="#FFFFFF" size="5" face="Tahoma, Verdana, Arial, Helvetica, sans-serif"><strong><? echo $g_title ?></strong></font></td>
<td class="bgblu" width="44%" align="right" valign="middle" height="80">
<div class="whitex">
<?
$check_user_info = mysql_query("SELECT visited, earned, refer FROM users WHERE name='$loguser'");
$row = mysql_fetch_array($check_user_info);
$vised = explode(",", $row[visited]);
for ($i = 0; $i < count($vised); $i++)
{
if ($vised[$i] == $adid)
$already_seen = 1;
}
if ($already_seen)
{
echo "<b>You have already recieved payment for this click!</b>";
}
elseif ($done)
{
$get_oldinfo = mysql_query("SELECT * FROM links WHERE linkid='$adid'");
$irow = mysql_fetch_array($get_oldinfo);
$hit = $irow[hits];
$hit++;
$tamount = $irow[total] - $irow[perclick];
$update_link = mysql_query("UPDATE links SET hits='$hit', total='$tamount' WHERE linkid='$adid'");
//GIVE REFERRER MONEY
$urefer = $row[refer];
$refer_amt = mysql_query("SELECT earned FROM users WHERE name='$urefer'");
$rrow = mysql_fetch_array($refer_amt);
$refadd = $irow[perclick] * 0.5 * $g_referral;
$refer_total = $rrow[earned] + $refadd;
$update_referrer = mysql_query("UPDATE users SET earned='$refer_total' WHERE name='$urefer'");
//END REFERRER PAYMENT
$new_visited = "$row[visited],$adid";
$new_earned = $row[earned] + $irow[perclick] * 0.5;
if (!$update_user = mysql_query("UPDATE users SET visited='$new_visited', earned='$new_earned' WHERE name='$loguser'"))
{
echo "<b>Error:</b> Your click transaction could not be processed!";
}
echo "<b>You have recieved payment for this click!</b>";
}
else
{
echo "<b>You will receive payment for this click after $time seconds!</b>";
?>
<meta http-equiv="refresh" content="<?=$time;?> URL=timer.php?adid=<?=$adid;?>&time=<?=$time;?>&done=1">
<?
}
?>
</div>
<a class="fracon" href="#" onClick="parent.window.close()">Close Window</a>
</td>
<td class="bgblu" width="5%" align="left" valign="middle" height="80"></td>
</tr>
</table>
</body>
</html>
Thanks to anybody who cares to look this over.