Beste,

Ik heb een vraag.
Ik heb een traffic exchange website, werkt prima maar heb 1 probleem met me exhange.
Na ongeveer 6-9 websites geladen stopt die er mee.

Hopelijk kan iemand mij daar mee helpen waarom die dat doet.

Dit is mijn file
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-61989399-1', 'auto');
  ga('send', 'pageview');

</script>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Traffic Exchange</title>
<link href="css/clon.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include('header.php');?>
<?php include('admin/includes/connection.php');?>
<? if($_SESSION['user_id']!='') { ?>
<div id='bottom-content-area'>
<div class='margin-top-10'></div>
<div class='margin-top-20'></div>
<?php if($_SESSION['limt']!='')
{	$_SESSION['limt']= 0;
} ?>

<script>

 window.onload = function() {
    /* set your parameters(
    number to countdown from,
    pause between counts in milliseconds,
    function to execute when finished
    )
    */
   // startCountDown(15, 1000, myFunction);
    }

    function startCountDown(i, p, f) {
		
    // store parameters
    var pause = p;
    var fn = f;
    // make reference to div
    var countDownObj = document.getElementById("countDown");
    if (countDownObj == null) {
    // error
    alert("div not found, check your id");
    // bail
    return;
    }
    countDownObj.count = function(i) {
    // write out count
    countDownObj.innerHTML = i;
    if (i == 0) {
    // execute function
    fn();
    // stop
    return;
    }
    setTimeout(function() {
    // repeat
    countDownObj.count(i - 1);
    },
    pause
    );
    }
    // set it going
    countDownObj.count(i);
    }

    function myFunction() {
    //alert("hi alex");
	
	ShowOptions(1);
    }
function popUpClosed() {
    window.location.reload();
}
var ajaxObj=new getAjaxObject();

function getAjaxObject()
		{
		  var XMLHttpRequestObject = false;
		  if (window.XMLHttpRequest)
			  {
			  	 XMLHttpRequestObject = new XMLHttpRequest();
			  }
			  else if (window.ActiveXObject)
			  {
			     XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
			  }
			  if (!XMLHttpRequestObject)
			  {
			     alert("Your browser does not support Ajax.");	   return false;
			  }
		  return XMLHttpRequestObject;
		}
//var loads=false;
function createpopup(website)
{
	//alert('popup');
popupWindow = window.open(website,'mypopup','width=400,height=400');
//popupWindow.onclose=function(){alert('unload');}	
//popupWindow.onclose = function(){ alert('unload');}
//popupWindow.onbeforeunload=function(){ alert('unload');}
}
function closeMe(evt) {
	alert('ff');
    /*if (typeof evt == 'undefined') {
        evt = window.event; }
    if (evt && evt.clientX >= (window.event.screenX - 150) &&
        evt.clientY >= -150 && evt.clientY <= 0) {
        return "Do you want to log out of your current session?";
    }*/
}
var callback = function(){
  //alert("foo");
  window.location.reload();
};
function pollForWindowClosure(){
  if(popupWindow.closed){
    callback();
    return;
  }
  
  setTimeout(pollForWindowClosure, 99999999999999999);
}


function changepopupurl(website)
{
	window.popupWindow.location=website;
	//popupWindow.onbeforeunload = function(){ alert('unload');}
///popupWindow = window.open(website,'mypopup','width=400,height=400');	
}
function ShowOptions(id)// kahi se call karo is ko
	{
		var limm= document.getElementById('sit').value;
	 //popupWindow = window.open(''name','width=400,height=400');
	 //if(loads)
	// {
	//window.opener.location.href='http://www.google.com';
	//alert('window'); 
	//}
	var xmlHTTPObject=new getAjaxObject();
	 var lim= document.getElementById('site').value;
	     var limm= document.getElementById('sit').value;
		  var website= document.getElementById('siturl').value;
		  //alert(website);
	
		if(id==0)
		{
			//Opt();
			
 
		//loads=true;
		 createpopup(website);
		 pollForWindowClosure();
		}
		else
		{
			changepopupurl(website);
		}
	
	  
//popupWindow.onunload = function() {
  //  if (window.opener && !window.opener.closed) {
   //     window.opener.popUpClosed();
 // }
 //alert('window');
//};
	 // popupWindow.focus();
	 var url='get-options.php?lim='+lim;
	 var parameters='123';
	  var timers;
 if(xmlHTTPObject)
		   {
			  if (xmlHTTPObject.readyState == 4 || xmlHTTPObject.readyState == 0)
			  {//alert(xmlHTTPObject.readyState);
				   xmlHTTPObject.open("GET", url, true);
				  // alert('open');
				  xmlHTTPObject.onreadystatechange =function()
					{
						if (xmlHTTPObject.readyState == 4)
						   {
							  if (xmlHTTPObject.status == 200)
							  {
								try
									{
										 var XMLResponse = xmlHTTPObject.responseText;
										 timers =XMLResponse;
										 document.getElementById('sites').innerHTML=XMLResponse;
										 var countDowntime=document.getElementById('countDowntime').value;
										 //alert(countDowntime);
										 Opt(countDowntime);
										 startCountDown(countDowntime, 1000, myFunction);
								}
								catch(e){}
							  }
						   }   
					};
				 xmlHTTPObject.send(null);
			  }
			}
				//setTimeout ( "ShowOptions(1)", 999999999999999999);
				return false;  
		
	
	}
function Opt(countDowntime)// kahi se call karo is ko
	{
var xmlHTTPObject=new getAjaxObject();
		 var url='update.php?countDowntime='+countDowntime;
	 var parameters='123';
	  var timers;
  if(xmlHTTPObject)
		   {
			  if (xmlHTTPObject.readyState == 4 || xmlHTTPObject.readyState == 0)
			  {
				   xmlHTTPObject.open("GET", url, true);
				    xmlHTTPObject.onreadystatechange = function ()
					{
						if (xmlHTTPObject.readyState == 4)
						   {
							  if (xmlHTTPObject.status == 200)
							  {
								try
									{
										 var XMLResponse = xmlHTTPObject.responseText;
											//alert(XMLResponse);					
									}
								catch(e){}
							  }
						   }   
					};
				 xmlHTTPObject.send(null);
			  }
			}
			//setTimeout ( "ShowOptions()", 9999999999999999999);
				return false;  
}	
</script>
<div  style="display:block" class="vertical-top" id="sites">
<?

$queryz2 = mysql_query("SELECT * FROM userwebsite WHERE minutes > '0' ORDER BY RAND()  LIMIT 1");
$resz2 = mysql_fetch_array($queryz2); 
	mysql_query("UPDATE userwebsite SET hits = hits + 1 WHERE uwid='".$resz5['uwid']."'")
	  or die(mysql_error());
mysql_query("UPDATE userwebsite SET minutes = minutes - 2 WHERE uwid='".$resz5['uwid']."'")
	or die(mysql_error());
mysql_query("UPDATE userwebsite SET minutes = minutes + 1 WHERE userid='".$_SESSION['user_id']."'")
	  or die(mysql_error());
mysql_query("UPDATE members SET hits = hits + 1 WHERE userid='".$resz5['userid']."'")
	  or die(mysql_error());
mysql_query("UPDATE members SET dohits = dohits + 1 WHERE userid='".$_SESSION['user_id']."'")
	  or die(mysql_error());
mysql_query("UPDATE stats SET totaalhits = totaalhits + 1 ")
	  or die(mysql_error());

?>

<input type="hidden" id="site" name="site" value="0">

<input type="hidden" id="sit" name="sit" value="<?=$resz5['uwid'] ?>">
<input type="hidden" id="siturl" name="siturl" value="<?=$resz5['website'] ?>">
<!--<input type="hidden" id="site" name="site" value="0">
<input type="hidden" id="sit" name="sit" value="15">
<input type="hidden" id="siturl" name="siturl" value="google.com">-->
<div class='session-status-section' id='explanation-with-start-button-section'>
<div class='text-align-center'>
<b>Warning first add a <a href="websites.php">Website</a> on your account before you go show websites! Or you dont will earn minutes!
The Traffic Exchange lets you earn Minutes by viewing websites. Your Minutes are automatically used to show your <a href="websites.php">Websites</a> to people all over the world.
</div>
<div class='margin-top-10 text-align-center'>
<form name="traffic" id="traffic" action="" method="post" onsubmit="javascript:Opt()"  accept-charset="UTF-8">
<div>
<center>
<input type="button" id="addRegisteruser" name="addRegisteruser" onclick="javascript:ShowOptions(0)" class="myButton" value="Start Traffic Exchange">
</center>
</div>


</form>
</div>
</div>
<!--<div class='session-status-section hidden' id='loading-traffic-exchange-section'>
<table style='width: 100%'>
<tr>
<td align='center'>
<table>
<tr>
<td align='right' style='width: 20px;'>
<div class='icon icon-ajax-loader' style='width: 20px; height: 16px;'></div>
</td>
<td align='left' class='bold' style='width: 150px; vertical-align: top'>
Loading Traffic Exchange
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class='session-status-section hidden' id='recently-viewed-websites-section'>
<table style='width: 100%'>
<tr>
<td class='vertical-top' style='padding-left: 30px'>
<div style='width: 500px;'>
<table>
<tbody id='recently-viewed-websites'>
<tr class='hidden website-row'>
<td style='vertical-align: top'>
<div class='timer'></div>
</td>
<td class='padding-left-5' style='vertical-align: top; padding-top: 3px'>
<a class='address' href='#' rel='external' style='font-size: 16px'></a>
<div class='hidden alternate_id'></div>
</td>
<td class='padding-left-5' style='vertical-align: top; padding-top: 3px'>
<div class='icon icon-cross-shield'>
<span class='noop-link block-website-link' style='font-size: 14px;'>
Block
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td class='vertical-top' style='padding-right: 30px'>
<table>
<tr>
<td>
<div class='bold' style='font-size: 16px'>
All-Time Minutes Earned
</div>
</td>
</tr>
<tr>
<td style='padding-top: 3px'>
<div class='text-align-center' style='font-size: 10px'>
(Updates every few minutes)
</div>
<div class='text-align-center bold' id='minutes-earned' style='color: #4D7D4B; font-size: 16px'></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class='session-status-section hidden' id='cant-display-website-section'>
<div class='bold text-align-center'>
Traffic Exchange Window is frozen or closed. Please click on the button to re-start.
</div>
<div class='text-align-center'>
<button class='open-traffic-exchange-link'>
Start Traffic Exchange
</button>
</div>
</div>
<div class='session-status-section hidden' id='temporarily-banned-section'>
<div class='bold text-align-center'>
Your browser doesn't load many of the websites. Please close other resource intensive programs. You can use the Traffic Exchange again in 24 hours.
</div>
</div>
<div class='session-status-section hidden' id='please-update-your-viewer-software'>
<div class='success'>
A new version of HitLeap Viewer is available. Please download it with your normal browser.
</div>
</div>
<div class='session-status-section hidden' id='javascript-disabled-message-section'>
<table style='width: 100%'>
<tr>
<td align='center'>
<span class='text-align-center icon icon-cross-small bold'>
Either your Javascript is not enabled for all domains or your connection is too slow. Adjust your settings and restart your session
</span>
</td>
</tr>
</table>
</div>
<div class='session-status-section hidden' id='opera-not-supported-section'>
<table style='width: 100%'>
<tr>
<td align='center'>
<span class='text-align-center icon icon-cross-small bold'>
The Opera Browser is not supported. Use Firefox or Chrome.
</span>
</td>
</tr>
</table>
</div>
<div class='session-status-section hidden' id='exchange-session-not-available'>
<table style='width: 100%'>
<tr>
<td align='center'>
<span class='text-align-center icon icon-cross-small bold'>
Only one account per IP can use the Traffic Exchange. Please try again in a few minutes.
</span>
</td>
</tr>
</table>
</div>
-->
</div>
<table class='margin-top-20' id='exchange-earning-ratios'>
<tr>
<td class='vertical-top' style='padding-left: 50px; padding-top: 20px'>
<div class='margin-top-20'></div>
<div class='bold font-size-24'>
Upgrade account
</div>
<div class='margin-top-10'></div>
You have a <a href="premium.php">Premium</a> account
</td>
</tr>
</table>

<div class='margin-top-40 vertical-line-spacer'></div>
</div>
<?
} else { ?>
<div id='bottom-content-area'>
<?php
echo '<h3><a href="login.php">Log in</a> with your creditentials to use these features</h3>';
?>
</div>
<? } ?>
<?php include('footer.php')?>

</body>
</html>

Zorg ook even dat je alle PHP short-tags er uit haalt.

Reageren