Jump to content


Photo

Stop scripts from reading text.


  • Please log in to reply
6 replies to this topic

#1 crimsonmoon

crimsonmoon
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 03 August 2006 - 09:31 PM

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.

#2 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 03 August 2006 - 09:47 PM

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.
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#3 crimsonmoon

crimsonmoon
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 03 August 2006 - 09:50 PM

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.

#4 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 03 August 2006 - 09:59 PM

For your GD, to stop the images cacheing

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

Tell me the problem, I will try tell you the solution

#5 crimsonmoon

crimsonmoon
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 04 August 2006 - 03:28 PM

Where would I put this? This is how I'm going it.

I have this page being called.

<?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);

Then I call the page above is the actual page showing it.

<img src=\"thepage.php\"/>


#6 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 04 August 2006 - 04:22 PM

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
Tell me the problem, I will try tell you the solution

#7 Vikas Jayna

Vikas Jayna
  • Members
  • PipPipPip
  • Advanced Member
  • 121 posts
  • LocationNoida, Delhi, India

Posted 04 August 2006 - 04:23 PM

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
Vikas Jayna,
Project Manager - Jeevansathi.com
7 yrs. exp. in LAMP
Certified Mysql DBA
Zend Certified Engineer




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users