Google Answers Logo
View Question
 
Q: small php script ( Answered,   0 Comments )
Question  
Subject: small php script
Category: Computers > Programming
Asked by: barbooth-ga
List Price: $52.00
Posted: 15 Jul 2004 08:17 PDT
Expires: 14 Aug 2004 08:17 PDT
Question ID: 374469
ive searched for a php script that i have in mind all over the web and 
i stumbled upon answers.google.com website with a question that answers 
half of what i need:

http://answers.google.com/answers/threadview?id=369452

seeing that this is a good place to have the whole package coded for me,
i need a script similar to the one above, but with additional features:

* the script grabs the visitors ip & a passed parameter named 'port' (via get)
* the script uses fsockopen (or similar) command to open a connection
to the visitor ip + passed port
* IF the connection is open, the script should also note how long it
took for the connection to open (in ms), and then using the example
from the question above, check the visitor IP against a number of
remote databases whether it was rbled.
* the script should then generate the results on the screen (printf or echo)

if anything is not clear please let me know
Answer  
Subject: Re: small php script
Answered By: webadept-ga on 15 Jul 2004 11:16 PDT
 
Hi, 

Okay, let's go through this.. 

* the script grabs the visitors ip & a passed parameter named 'port' (via get)

I added two other paramaters so that I could test this inside my network, and 
left them there for you. If you set the test = 1 you can put and IP in
the get as well.


* the script uses fsockopen (or similar) command to open a connection
to the visitor ip + passed port
That's a done deal

* IF the connection is open, the script should also note how long it
took for the connection to open (in ms), 
Using the function microtime for this, as requested, you can see the stats
on this function at the php.net site
http://us4.php.net/microtime
Now you have there "open" which is exactly what I'm measuring, not to
close and move on.. open


and then using the example
from the question above, check the visitor IP against a number of
remote databases whether it was rbled.

* the script should then generate the results on the screen (printf or echo)

okay, well that's what this does. I added two sites to his example,
pulled some stuff, added a few things like html formating functions so
you can change the
page to look as you want it too .. and this should be a done deal. 

f you have any questions on it, just drop a Clarification Request and
I'll look into it for you. Your fresh baked php is at :

http://68.15.21.151/uploads/researchers/blockedby.zip

word of caution, some how, make sure that this isn't used by several
thousand a day, as these services offered by the rbls are on volentary
bandwidth and dababases.

thanks, 

webadept-ga
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy