Jump to content

Archived

This topic is now archived and is closed to further replies.

crimsonmoon

Stop scripts from reading text.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
For your GD, to stop the images cacheing

[code]
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
[/code]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

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.