error_404 Posted February 16, 2008 Report Share Posted February 16, 2008 Dear all,I would like if it's possible to receive the source code for TestPOrt because I want to integrate it to one CMS system in the INTRANET for INTERNAL use only.This is the reason for what i'm searching the NET and I like your TestPort how it works.http://www.utorrent.com/testport.phpIf somebody can help because i'm a noob in PHP!Thank you in advance. Link to comment Share on other sites More sharing options...
dAbReAkA Posted February 16, 2008 Report Share Posted February 16, 2008 if (!fsockopen($_SERVER['REMOTE_ADDR'], (int)$_GET['port'], $errno, $errstr, 10)) echo 'there's nothing on that port';else echo 'connection successfull';access with: testport.php?port=X Link to comment Share on other sites More sharing options...
error_404 Posted February 17, 2008 Author Report Share Posted February 17, 2008 Thank you in advance I'l check now!This is the full code or part of that code used in testports.php?!?!?!Thanks again!I try this but t's not working!<?php// if getenv results in something, proxy detectedif (getenv('HTTP_X_FORWARDED_FOR')) {$ip=getenv('HTTP_X_FORWARDED_FOR');}// otherwise no proxy detectedelse {$ip=getenv('REMOTE_ADDR');}// print the IP address on screenprint ('<span class="style1">YOUR IP IS: </span><span class="style2">'.$ip.'</span></br>');if (!fsockopen($ip, (int)$_GET['port'], $errno, $errstr, 10))else { print ('<span class="style1">NOT OPEN PORT</span></br>');} else { print ('<span class="style1">OPEN PORT</span></br>');}?> Link to comment Share on other sites More sharing options...
dAbReAkA Posted February 17, 2008 Report Share Posted February 17, 2008 else { print ('<span class="style1">NOT OPEN PORT</span></br>');}here's the problem it cant parse the filechange it to:{ print ('<span class="style1">NOT OPEN PORT</span></br>');}btw you can change "!fsockopen" to "!@fsockopen" to prevent it from outputting errors here's the final version:<?phpif (!$ip = getenv('HTTP_X_FORWARDED_FOR')) // if getenv results in something, proxy detected$ip=getenv('REMOTE_ADDR'); // otherwise no proxy detected// print the IP address on screenprint ('<span class="style1">YOUR IP IS: </span><span class="style2">'.$ip.'</span></br>');if (!@fsockopen($ip, (int)$_GET['port'], $errno, $errstr, 10)) print ('<span class="style1">NOT OPEN PORT</span></br>');else print ('<span class="style1">OPEN PORT</span></br>');?> Link to comment Share on other sites More sharing options...
Neutrinox Posted July 7, 2008 Report Share Posted July 7, 2008 Hello, could any one help me with his sticky problem I'm having with php sockets (I'd really appreciate it, I've been trying to find the cause of the problem since weeks now)okay.. now lets consider this script: (credits to bugmenot)http://www.erickxavier.com/test_port.php?inicio=80&fim=90it shows you open ports from 80 to 90. My router has ports 82 and 88 OPEN, and the script shows ports 82 and 88 open.. Works.BUT when I copy it to my web server.. it shows PORT CLOSE for all ports (thats the same script, different results!)I contacted my web server and they said php sockets are disabled on the server due to security reasons. Well as mad as I was, I felt relieved for finally figuring out the cause of the problem. Well, maybe NOT!I then singed up for a free web host to test the script at www.000webhost.com and PLEASE take a look at this page http://www.000webhost.com/free-php-hostingit says that fopen() and PHP sockets are SUPPORTED. but I the script shows PORT CLOSE for all ports... NOT AGAIN :mad: (now this is really crazy) what is this? a discriminating script of some kind???IP: 89.108.156.150 (you can copy the script and replace the IP declaration)Ports OPEN: 82, 88You can find the script here: http://forum.utorrent.com/viewtopic.php?id=38356 (bugmenot post) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.