Jump to content

Stop scripts from reading text.


crimsonmoon

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.
Link to comment
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.
Link to comment
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]
Link to comment
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
Link to comment
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
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.