|
| Joined: | 03 Jun 2004 | | Posts: | 1 |
|
 |
Posted: Thu Jun 03, 2004 8:28 am |
|
 |
 |
 |
 |
There is some bug in my script, it's a javascript combined with php, well I'm quite sure the bugisn't in the php so maybe sm can take a look at it.
this is the script:
<?php
require('connect.php');
?>
<?php
$query2 = "SELECT * FROM recruiter WHERE username='$username'";
$result2 = mysql_query ($query2)
or die ("Query failed2");
$row2=mysql_fetch_array($result2);
$credits=$row2['credits'];
if($credits>=350){
$query3 = "UPDATE recruiter SET max='y' WHERE username='username'";
$result3 = mysql_query ($query3)
or die ("Query failed3");
$query4 = "SELECT * FROM recruiter WHERE username='$username'";
$result4 = mysql_query ($query4)
or die ("Query failed2");
$row4=mysql_fetch_array($result4);
$max=$row4['max'];
}
if($credits<=350){
$query5 = "UPDATE recruiter SET max='n' WHERE username='username'";
$result5 = mysql_query ($query5)
or die ("Query failed3");
}
$querya = "SELECT stamp FROM recruiter WHERE username='$username'";
$resulta = mysql_query ($querya)
or die ("Query failed1");
$stamp=mysql_fetch_array($resulta);
$time=time();
$clicked=$time+3000;
$query1 = "SELECT * FROM recruiter WHERE credits>0 AND stamp>$clicked ORDER BY credits DESC LIMIT 0 , 1";
$result1 = mysql_query ($query1)
or die ("Query failed");
$row=mysql_fetch_array($result1);
$link1=$row['link'];
?>
<style type="text/css">
<!--
a:link { text-decoration:none; font-weight:bold; color:#FFFF00; }
a:visited { text-decoration:none; font-weight:bold; color:#FFFF00; }
a:hover { font-weight:bold; color:#FF0000; }
-->
</style>
<html>
<head>
<script language="JavaScript" type="text/javascript">
var Zeit = 20;
var durch = 0;
function doTime()
{if(document.formular.pause.checked==false){
if (Zeit >= 0) {
Zeit--;
document.formular.count.value = Zeit;
aktiv = setTimeout('doTime()', 1000);}
else clearTimeout(aktiv);
if (Zeit == 0) {
durch++;
<?php
if($max=='n'){
if($credits>=350){
$query6 = "UPDATE recruiter SET credits=credits+1 WHERE username='username'";
$result6 = mysql_query ($query6)
or die ("Query failed3");
} }
?>
if (durch == 1000){
window.location.reload()
}
parent.mainFrame.location.href=<?php echo $link1 ?>;
Zeit = 20;
};
}else aktiv=setTimeout('doTime()',1000);}
</script>
<meta name="author" content="ô2Ø">
</head>
<BODY onload="doTime()" BGCOLOR="#006699" TEXT="#ffffff" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=2 MARGINHEIGHT=0>
<?php
echo $username;
?>
<td><form name="formular">
<table width="969" border="0" height="64">
<tr>
<td width="268" height="1">
</td>
<td rowspan="4" width="94" height="58">
<font face="Verdana">
<a target="_blank" href="http://www.126hits.com/ads.htm">
Buy Credits</a></font></td>
<td rowspan="4" width="585" height="58">
<div align="center">
</div>
</td>
</tr>
<tr>
<td width="268" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">receive Credits in
<input type="text" name="count" size="2" >
Sec. </font></td>
</tr>
<tr>
<td width="268" height="20">
<input type="checkbox" name="pause" value="ON"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">stop Counter
</td>
</tr>
</table>
</form></td>
</body>
</html>
|
You can find an example here:
http://www.thelastalliance.net/recruiter/recruiter.php
when the counter reaches zero it's supposed to load a new link but it doesn't[/code]
|
|
|