crimsonmoon Posted August 3, 2006 Share Posted August 3, 2006 I have a script that displays a rate on a page. This rate changes every minute and can be from 1 to 200. They get more benifits if they use the script when the rate is higer.So the page displays what the rate is by pulling it from the MYSQL table.I've got some who have a program that reads the text on the screen and if it's a high number then it uses the script.How can I stop this.I thought about a GD image for the rate but I've had issues with those not showing correctly almost like they are being cached.Any other suggestions? They're obviously refreshing numerous times. I've thought about limited the amount of times you can visit the page per hour but that might ruin the fun. Quote Link to comment Share on other sites More sharing options...
Buyocat Posted August 3, 2006 Share Posted August 3, 2006 Can you explain further what you mean by "I have a program that reads the text on the screen if the number is high enough?" Because it sounds like if you don't want the program to run then why not encase the code that starts it in an if clause that evaluates to false when you don't want it to run (such as when the number is high). It just isn't clear what you're trying to stop from happening. Quote Link to comment Share on other sites More sharing options...
crimsonmoon Posted August 3, 2006 Author Share Posted August 3, 2006 Players use a program to read the text on the screen if it's a high number then the program clicks and uses the script. Basically their cheating and taking the randomness away. They leave the program running at all times to montior this page. Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 3, 2006 Share Posted August 3, 2006 For your GD, to stop the images cacheing[code]<META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Expires" CONTENT="-1">[/code] Quote Link to comment Share on other sites More sharing options...
crimsonmoon Posted August 4, 2006 Author Share Posted August 4, 2006 Where would I put this? This is how I'm going it.I have this page being called.[code]<?php mysql_connect("localhost", "user", "pass");mysql_select_db("db");$click = mysql_fetch_array(mysql_query("select * from table"));$image = imagecreate(140, 30);$white = imagecolorallocate($image, 255, 255, 255);$gray = imagecolorallocate($image, 210, 210, 210);$black = imagecolorallocate($image, 0, 0, 0);$string = "$click[variable]";for ($i=0; $i<25; $i++) { $x1 = rand(0,140); $y1 = rand(0,30); $x2 = rand(0,140); $y2 = rand(0,30); imageline($image, $x1, $y1, $x2, $y2 , $gray); } $size = rand(4, 5); $x = rand(12 , 80); $y = rand(7 , 12); imagestring($image, $size, $x, $y, $string , $black);header("content-type: image/png");imagepng($image);imagedestroy($image);[/code]Then I call the page above is the actual page showing it.[code]<img src=\"thepage.php\"/>[/code] Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 4, 2006 Share Posted August 4, 2006 the meta tags to stop caching goes in the HEAD of the script<html><head><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Expires" CONTENT="-1"><title>The Website Title</title></head><body>Note that meta can go anywhere in the head, does not have to be above title Quote Link to comment Share on other sites More sharing options...
Vikas Jayna Posted August 4, 2006 Share Posted August 4, 2006 If the number of people trying these tricks is few, you can have IP address checks either in your scripts or at the webserver level. Apache mod_throttle is a module that checks the number of request per unit time from a particular IP and can stop serving those requests after a certain threshold level Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.