NeOniX
Jun 17 2006, 05:22 AM
Some days ago, i needed to check ports of a server from a webpage, for advising of its status. I simply used a great php code that's fsockopen. I'll explain it in the following example: (Imagine a file called 'checkports.php', containing the next) CODE <? $address =" trap17.com"; //Here you can specify the address you want to check ports $port = "80"; //Here you can specify the port you want to check from $address $checkport = fsockopen($address, $port, $errnum, $errstr, 2); //The 2 is the time of ping in secs
//Here down you can put what to do when the port is closed if(!$checkport){ echo "The port ".$port." from ".$address." seems to be closed."; //Only will echo that msg }else{
//And here, what you want to do when the port is open echo "The port ".$port." from ".$address." seems to be open."; //The msg echoed if port is open } ?> Well, that's all, but you can do with it a lot of interesting stuff, i.e., you put that on a host with PHP, and check if another host is up, and it is, redirect to... etc. Enjoy! 
Reply
uiop
Jun 17 2006, 05:49 PM
Awsome code! Thanks a ton for it! I'm not really sure what I can use it for, but it sounds cool! Do you need any special server permissions to run this script? Will it run on all servers?
Reply
NeOniX
Jun 17 2006, 07:07 PM
QUOTE(uiop @ Jun 17 2006, 07:49 PM)  Do you need any special server permissions to run this script? Will it run on all servers?
Lol er... well dunno if all servers let u using fsockopen(), cuz i actually use my own server, so i suppose it depends of the host. You could post a topic on a forum askin' 4 that.  Anyway, yesterday i try to use on a free hosting server with PHP, and it gave me back an error like 'Due to security reasons...'  (note: tried out in trap17 hosting and works)
Reply
masterio
Aug 27 2006, 11:14 AM
Well, i didnt know if trap17.com disable some function like fsockopen(), shell_exec(), passthru(), and many other PHP function to communicate with filesystem. I think it may be disable for security reason...!  . By the way fsockopen() is usefull for grabbing page, etc besid file_get_contents() function.
Reply
Recent Queries:--
php check ip port open - 2.88 hr back. (2)
-
checking port in use , batch script - 10.61 hr back. (1)
-
check server ping php - 19.37 hr back. (1)
-
how to check port status javascript - 23.52 hr back. (1)
-
how to check if the port is open javascript - 23.59 hr back. (2)
-
how to test if all my ports are open? - 25.18 hr back. (1)
-
php list openned ports - 28.45 hr back. (1)
-
check if echo port is open - 45.44 hr back. (1)
-
port open checker - 46.59 hr back. (1)
-
how to open ports in php - 48.83 hr back. (1)
-
open ports for php mysql - 50.79 hr back. (2)
-
php check server mail ports - 53.73 hr back. (1)
-
php script to check open ports - 81.56 hr back. (3)
-
test open ports in windows - 84.35 hr back. (1)
Similar Topics
Keywords : checking, open, ports, php, check, status, server, specific, port
- How To Make Your Own Counter Strike Source Dedicated Server!
(6)
How To Create Counter-strike 1.6 Server In Console Mode
(5) Hello! Now I will show you how to create a CS 1.6 Dedicated server /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> 1. Locate HLDS.exe. It
could start it from Steam. 2. Make a batch file. You could name it how you like, I writed it as
start.bat. It should be located in the same folder as the HLDS.exe. It should contain something like
this: CODE HLDS.EXE -console -game cstrike -port 27015 +maxplayers 24 +map bl_counterquake
+sv_lan 0 +rcon_password yourrconpass -secure I recommend -console to be there, couse it starts
hld....
Starting Or Stopping Apache And Mysql Server Via Batch File
(0) Hi guys, this is a litte tutorial about how we start and stop the Apache and MySQL in Windows NT
(2000, XP, 2003) via a batch file script. As we know in Windows NT based system Apache and MySQL
installed as Windows Services. So we can stop and start it using NET command. For more information
about DOS command, type HELP at command prompt. I assuming that your MySQL service name is "mysql"
and your Apache (Apache 2.0.x) service name is "apache2". If you want to chek it click Start > Run >
services.msc > OK. Windows IS NOT Case Sensitive. Let's get started!. 1. ....
Making A Dynamic Page On Blogspot
Using an external server to make your pages hosted on blogspot dynamic (5) Good morning everyone. Have you ever wondered how to allow your visitors to edit content on your
blog? Like adding a post straight off the page, adding a link, editing your profile etc. This will
be extremely useful if you want your visitors to contribute to your blog besides writing comments or
tagging. 1. Adding a post straight off the page. Go to blogger.com, login, select your blog. Go to
settings -> email. By enabling blog email, you can now add a post by simply sending an email to the
address you specified. The address should look something like: yourusername....
Checking Dns Settings For Website
DNS Setting, Ping, Whois, Dnsreport etc (2) If you have recently purchased a domain and facing problems with the workings, the first thing which
you should check is the DNS setting. Dns settings determine, how to domain is pointed to the Server
and How the server is connected to the world (internet). Ensure, the DNS settings are perfect to
make sure, things work smoothly and people across the globe don't have problems accessing your
site. The basic check would be : PING Suppose you register your domain (example.com) at
ComputingHost. You get an IP for your website. In this case, suppose its 64.69.35.170. Yo....
Pinging Servers
Checking the webhost's speed! (16) The instruction's below were tested on Windows XP only. 1) Click on the "Start Menu" then click
on "Run". 2) Type "command" (without quotes) into the run box and click OK. 3) Wait for text to
appear on the screen. 4) Type "ping" (without quotes) followed by a space and the web host's
domain. Example: "ping www.trap17.com" (without quotes) 5) Wait for text to finish appearing on the
screen. 6) The text on the screen should look something like this: QUOTE Ping www.geocities.com
with 32 bytes of data: Reply from 66.218.77.68: bytes=32 time=79ms Reply fr....
Run Your Own Mail / Radio Server
SHOUTcast and more (24) firstly i want to point out that i did have alot more images that i took for this tutorial but i was
only aloud to show 15 in this post /sad.gif" style="vertical-align:middle" emoid=":(" border="0"
alt="sad.gif" /> ill ask for the ammount to be raised then i can add the rest in /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> ok here we go.. Audio
Streaming Server (Radio) What is a Streaming Audio Server Its an application that will allow you to
"stream" or send a continuous block of data to a client. In a few words, it will allow....
A Nice Mysql Server Check
(4) I made this and its not very hard at all just fill in the info and it willl see if your mysql is up
or down CODE <html> <head> <title> Mysql Connection Test
</title> </head> <body> <h2> <?php // On this you need to put
your host most of the times localhost username and password. $conncect = mysql_connect (
"host", "Username", "password" ) or die (" Sorry your server
can't connect to your mysql server <BR> Check to see you have put in the Username and....
Set Os X Server 10.3 Dhcp To Filter Desks
Restrict which PCs/Macs get DHCP IP #s (0) Among my other duties, I help run a small computing lab for med students at the U of MN. Recently I
learned that though we only have about twenty legitimate DHCP clients on our wired ethernet getting
addresses from our Mac OS X 10.3 Server (great system), thirty allocated DHCP addresses were being
used. Huh? I found that some addresses went to testing, which I understand, but others were being
grabbed by PCs that should have static IPs but were misconfigured and/or by outsiders who unplugged
our PCs to network personal laptops (a no-no). We don't watch our PCs all t....
Server Status
MAke Your own server status in PHP (12) My Friend and i made an mmorpg we decided to make a code so the users could tell when the game
server was running this codoe has many other uses to like monitor a website or w/e you want to do.
CODE <? $ip = "youriphere"; $port = "yourporthere"; if
(! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo '<B><FONT COLOR=red>Offline</b></FONT>'; else{ echo
'<B><FONT COLOR=lime>Online</b></FONT>'; fclose(....
How To Setup Your Own Dns (domain Name Server)
(1) How To Setup Your Own Dns (Domain Name Server) This is only a quick tutorial, there are literally
hundreds of little tricks you can do with a DNS, but this will get your basics up and running.
I'm assuming you want to setup a windows DNS server, but the principals will work for most
servers. You will need.. 1) A domain name over which you have full control 2) DNS server
software(Windows server always comes with one of these) 3) At least one fixed IP address, allthough
two is highly desirable 4) An idea of what services you want on your server The first thing you ....
Checking Your Php Version
check your version of your server (1) This is a very easy tutorial, others may know of this... step 1 => Download the attachment step 2
=> upload to your public directory step3 => open and run the files and you'll get a whole list
of your server environment and so on.......
Image Preloader With Progress Bar Status
Pure Client-Side JavaScript tested in 4 Browsers! (22) Tutorial: Image Preloader with Progress Bar, by Rob J. Secord, B.Sc. (SystemWisdom)
Description : A Tutorial for a Client-Side Image Preloader with Dynamic Real-Time Progress Bar
Indicator written in JavaScript! Tested to work with 4 Major Internet Browsers: Firefox, MSIE,
Netscape, Opera (Complete sample solution provided at end of tutorial, just put it on your
web-server, add your images and go!) Intended Audience : Beginner to Intermediate Web
Developers. Although this tutorial will cover some advanced aspects of JavaScript, I will try to
explain....
Checking The Web Site Speed
(10) Did you taking too much time to access your favorite sites? Probably the problem is on the server
used by those sites. To make sure that is the problem, use Windows PING facility. Ping is a small
program, which sends a 32-bit signal to the Web site server. Next, Ping record the time needed by
the server to answer it. To activate Ping: Click on the Start-Run menus, type command, and then
click OK. Type PING "site name" in the MS-DOS prompt window, for example PING www.yahoo.com. In a
moment, the result will appear on the screen. A result less than 300ms is normal spee....
Installing And Connecting To A Ventrilo Server
(0) 1: Download The Client From http://www.ventrilo.com/download.php 2: Install The Client 3: Boot
The Client 4: Click the Arrow Pointing to the Right beside the User Name Tab. 5: Click The New
Button 6: Type In Your Desired Username And Hit Ok 7: In The Phonetic Spot, type your username
again 8: Enter A Description If Wanted and click ok 9: Click the arrow pointing to the right
beside the server tab. 10: click the new button. 11: Type in a name for the server. 12: Type in
the server address that you are connecting to in the Hostname or IP slot. 13: Click Ok. ....
Checking Form
check for validate (0) Hi all, I'v code that checking for your form. How's works? - When input text was emptied
or up to you(you said s/he must enter text more than the value or anything else). - When it was
worked, the message will show under input box. CODE // java script for checking form.
<script type="text/javascript"> <!-- function checkValidable() {
var check = 0; var v1 = document.loginForm.Name.value.length; var v2 =
document.loginForm.StID.value.length; if (v1 < 1) { check = 1;
note1.style.display = '....
Looking for checking, open, ports, php, check, status, server, specific, port
|
|
Searching Video's for checking, open, ports, php, check, status, server, specific, port
|
advertisement
|
|