Jump to content

number of times requested


The Little Guy

Recommended Posts

I give them this code (past onto their server):

 

<script type="text/javascript">
var idNum = '1';
var projectID = '6';
var projectCode = 'eb7sv7vnwc'
</script><script type="text/javascript" src="http://superstats.phpsnips.com/javascripts/stats.js"></script>

 

If they edit it if they they want, but then then they wont be able to see their website's stats.

 

The code that it access looks like this (on my server):

// JavaScript Document
var width=screen.width;
var height=screen.height;
var ref=document.referrer;
var loca=document.location;


var to_str = 'location='+loca+'&width='+width+'&height='+height+'&ref='+ref+'&owner_id='+idNum+'&project_id='+projectID+'&projectCode='+projectCode;
if(!called){
document.writeln('<script language="JavaScript" src="http://superstats.phpsnips.com/javascripts/jsProcess.php?'+to_str+'"></script>');
}
var called = true;

Link to comment
Share on other sites

The best thing I thought you could do is automatically run AJAX to post parameters to a PHP page about the details of the referrer, etc.. and update the database that way.

 

Since they use javascript to access YOUR javascript, anything you want to do must be written up in your javascript.

 

Hence, by using AJAX, you can:

 

1) update their information on how they've accessed your site

2) check to see if they've accessed too many times, etc...

Link to comment
Share on other sites

I was actually able to write a .htaccess file, that take the request and runs it though a PHP file, that way I can check things using PHP....

 

Here is what I have so far...

 

header("Content-type: application/x-javascript");
if(basename(__FILE__) == basename($_SERVER['PHP_SELF'])){
//if($_SERVER['HTTP_REFERER'] == 'http://superstats.phpsnips.com/javascripts/stats.js'){
echo 'No Access!';
}else{
readfile('stats.js');
}

//print_r($_SERVER);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.