I'm on my knees begging (PHP stats related)

Man of Honour
Joined
30 Oct 2002
Posts
15,807
Location
Surrey
OK so I've got mine to take nearly all the variables from the URL string, now to stop peeps abusing it I want to check if the handle variable in the url string exists in a CSV text file

e.g.

http://blahblah/sig.php?handle=Biffa

Text file: Biffa,MDPlatts,Mark G,

Anyone have a snippet of PHP that would check to see if the handle is in the text file?

That way I can just chuck someones nickname in the text file (after checking they are with OcUK first)
 
Associate
Joined
24 Nov 2002
Posts
165
Location
Leicester, UK
good idea, though dont you need the email account for each user ? and each user would prolly want the text in a different place on different images etc ?

Valor.
 
Man of Honour
Joined
30 Oct 2002
Posts
15,807
Location
Surrey
Well no, all you need is the handle, the query string in the URL can handle everything else, yes its a long query string but no bigger than one of the older seti-sig scripts we used to use.

It handles email, handle, x/y, rgb, font size. img url
 
Associate
Joined
24 Nov 2002
Posts
165
Location
Leicester, UK
sounds pretty cool,

Cant you query b0rkley for the team name associated with the handle ? then if it doesnt match ocuk write "I'm a OCUK wannabe" all over thier image etc ?

Valor.
 
Man of Honour
Joined
4 Nov 2002
Posts
15,508
Location
West Berkshire
Originally posted by Biffa
Anyone have a snippet of PHP that would check to see if the handle is in the text file?
Code:
<?php
  // Where to get the list of handles from
  $HandleList="/home/www/html/data/handles.lst";

  $handle=$_GET["handle"];
  if($handle=="") $handle="none";

  $found=false;
  $fp=@fopen($HandleList,"r");
  if($fp)
  {
    while(!$found && !feof($fp))
      $found=!strcasecmp($handle,trim(fgets($fp,256)));
    fclose($fp);
  }

  if($found)
    print "$handle is permitted.";
  else
    print "$handle is not permitted.";
?>
Expects the handles to be listed one per line.
 
Last edited:
Man of Honour
Joined
30 Oct 2002
Posts
15,807
Location
Surrey
Hmm.. well I decided to use email addresses instead, bit safer, plus if it checks to see if the email address is in there it uses that for the stats as well so if someone tries to get around it they just get the wrong stats in their sig :D

Umm.. syntax is

http://www.3dgfx.net/seti/sig/sig.p...www.dynaman.demon.co.uk/seti/sig/new_sig2.jpg

So you need to know:

h = Your Seti Handle (this is so I can keep the cache files separate)
email = Your Seti email
rgb colours
xy position
url= your image url

Oh and you would need to tell whoever is hosting it your seti email address to add to the list :)

I'm sure those with SQL skillz could make a much better job but hey.. my first play with PHP :D
 
Associate
Joined
24 Nov 2002
Posts
165
Location
Leicester, UK
Biffa, I want to make an interface for your script, to take some of the hassel out of it...

Did you find a way to get berkly to check for team membership? having to get added to an access file is a major slow down =/

failing that could you add "[email protected]" "Valor" to your listing so I can test it,

Thanks,

Valor.
 
Soldato
Joined
18 Oct 2002
Posts
10,678
Location
Castle Anthrax
Originally posted by Valor
http://cgi.kaiowas.plus.com/divisions/sigsetup.php


umm, I'll get my coat....


Can you add Text Rotation pls, and try to avoid any non automatic user autherisation.


Valor.

No authorisation is required, although you do need to be a member of OcUK. Text rotation is a possibility and I'll add it to the list of things to do but It's not a high priority.
 
Back
Top Bottom