Hello.
I have a traffic exchange script .. and i want to add in surfbar.php a link to current site that is viewed ..
surfbar.php
PHP Code:
<?
// The standard rules and regulations apply. All code is developed
// by http://www.allthetraffic.com and you should visit there if
// you want the newest version or to check out any of our other
// programs. We'd prefer if you don't go selling this to other
// people, but if you do, please remember the donate link on
// the website keeps us alive.
// ------------------------------------------------------------
require 'require.inc.php';
?>
<html>
<head>
<script>
<!--
var timeout = 1000; var num = 0; var na = "00"; var secs = <?
if (@$utype == "gold") {
echo $goldSurfTime;
} else {
echo $surfTime;
} ?>;
function go(){ na = secs; if (secs < 10) { na= "0" + na; }
document.getElementById("countDownText").innerHTML = na;
secs = secs - 1;
if (secs < 6) {
window.focus();
}
if (secs < 1) {
document.getElementById("countDownText").innerHTML = "<form action=surf.php method=POST target='_top'><input type=hidden name=togive value='ha'><?
srand((double)microtime()*1000000);
$num = rand(1, 2);
if ($num == 1) {
echo "<input type=submit value='Click aici'>";
} else {
echo "<input type=image src='next.gif'>";
}
?></form>";
}
if (secs > 0) { setTimeout("go();",timeout); }
}
-->
</script>
</head>
<body onload="go();" bgcolor=green text=white link=yellow vlink=yellow>
<table width=100%><tr><td valign='top'>
<?
srand((double)microtime()*1000000);
$numb = rand(1, 2);
if ($numb == 1) {
include 'banner.php';
echo "</td><td><span id='countDownText'></span>";
} else {
echo "<span id='countDownText'></span></td><td>";
include 'banner.php';
}
echo "</td><td>";
?>
</td></tr></table>
surf.php
PHP Code:
<?
// The standard rules and regulations apply. All code is developed
// by http://www.allthetraffic.com and you should visit there if
// you want the newest version or to check out any of our other
// programs. We'd prefer if you don't go selling this to other
// people, but if you do, please remember the donate link on
// the website keeps us alive.
// ------------------------------------------------------------
session_start();
require 'require.inc.php';
if (!isset($_SESSION['username'])){
header ("Location: index.php?invalid=PLEASE LOGIN");
}
$query = "SELECT * FROM $user_table WHERE userid=".$id;
$result = mysql_query($query) or die ("There's been a bit of an error. " . mysql_error());
$row = mysql_fetch_array($result);
$memtype = $row["type"];
//ONLY PAYING IF minimum SECONDS IS OVER
if ($memtype == "gold") {
$surfTime = $goldSurfTime;
}
$old = $row["lastsurfed"] + $surfTime;
mysql_query("UPDATE $user_table SET lastsurfed=".time()." WHERE userid=".$id);
echo "<!-- Updating lastsurf time of user ". $username ." -->";
echo "<!-- ".$row["lastsurfed"]." + $surfTime = ".time()."-->";
if ($old > time()) {
$nopay = 1;
$url = "about:You are surfing too fast. Please wait.";
} else {
//FINDING AN OPEN WEBSITE
$query = "SELECT $user_table.userid, $user_table.points, $user_table.username, $websites_table.id, $websites_table.url, $websites_table.userid, $websites_table.active
FROM $user_table INNER JOIN $websites_table ON $websites_table.userid = $user_table.userid
where $websites_table.active='y' and $user_table.points >0 and $websites_table.userid !=".$id." order by rand()";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
if (mysql_num_rows($result) != 0) {
$wrow = mysql_fetch_array($result);
$url = $wrow["url"];
echo "<!-- removing 1 points from link owner ". $wrow["username"] ."-->";
mysql_query("UPDATE $user_table SET points=points-1 WHERE userid=".$wrow["userid"]);
mysql_query("UPDATE $websites_table SET stats=stats+1 WHERE id=".$wrow["id"]);
} else {
$url = $defaultsite;
echo "<!-- No websites found, showing default -->";
}
if (@$HTTP_POST_VARS["togive"]) {
if ($memtype == "gold") {
mysql_query("UPDATE $user_table SET points=points+$goldreturn WHERE userid=".$id);
} else {
mysql_query("UPDATE $user_table SET points=points+$sreturn WHERE userid=".$id);
}
mysql_query("UPDATE $user_table SET surftime=surftime+$surfTime WHERE userid=".$id);
} else {
echo "<!-- User loaded first or refreshed. No soup for you!-->";
}
} // END CHECK FOR SURFING TOO FAST
?>
<HTML>
<HEAD>
<SCRIPT>
if (top.location != self.location) {
top.location = self.location;
}
window.focus();
</SCRIPT>
<TITLE>Surfing - <? echo $title; ?>: You have <? echo $row["points"]; ?> points</TITLE>
</HEAD>
<FRAMESET ROWS="20,*" FRAMESPACING="0" BORDER="0"><FRAME MARGINWIDTH="0" MARGINHEIGHT="0" NORESIZE SCROLLING=NO SRC="surfbar.php?utype=<? echo $memtype; ?>&togive=<? print @$togive; ?>&webid=<? echo @$wrow["id"]; ?>" FRAMEBORDER="0"><FRAME MARGINWIDTH="0" MARGINHEIGHT="0" NAME="bottom" SCROLLING=AUTO SRC="<? print $url; ?>" FRAMEBORDER="0">
<NOFRAMES>
<BODY>
<P>
This page is designed for use with a browser that supports frames.
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML>
If someone can help me , il be very very grateful
ty and sry my bad english