Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-17-2003, 06:09 AM   PM User | #1
lil_drummaboy
New to the CF scene

 
Join Date: Apr 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
lil_drummaboy is an unknown quantity at this point
Cool IP + Port Checker, is it Possible?

I need a JavaScript or preety much any script for that matter, that can scan an IP including the port so for example = 45.234.2.12:27015. I need the script to check if that IP and port are responding and write "Yes" or "NO" when the results are in. This should be a good challenge, i tried myself but I'm not that good. Can anyone show me up?

Last edited by lil_drummaboy; 04-17-2003 at 06:16 AM..
lil_drummaboy is offline   Reply With Quote
Old 04-17-2003, 06:39 AM   PM User | #2
beetle
Senior Coder

 
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
beetle has a little shameless behaviour in the past
Doing this with javascript is like visiting codingforums w/o an internet connection.

Hint: impossible
__________________
My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
“Minds are like parachutes. They don't work unless they are open”
“Maturity is simply knowing when to not be immature”
beetle is offline   Reply With Quote
Old 04-17-2003, 06:41 AM   PM User | #3
Skyzyx
Regular Coder

 
Skyzyx's Avatar
 
Join Date: Aug 2002
Location: Silicon Valley, CA
Posts: 980
Thanks: 0
Thanked 0 Times in 0 Posts
Skyzyx is on a distinguished road
#1) You need to read the posting guidelines to know that your subject line sucks.

#2) To show the IP and Port, you could use PHP:

Code:
<?php
echo '$_SERVER["REMOTE_ADDR"] : $_SERVER["REMOTE_PORT"]';
?>
Unfortunately, PHP and JavaScript can't share variable values, so you'll have to modify this snippet to send the values to hidden form inputs, submit the form, via GET, to a new PHP page, and parse the URL with JavaScript to determine what IP and Port are being used.

I'm going to bed, so I'm not going to write anything more right now. I suggest you check out PHP.net for documentation, and then learn how to parse URLs with JavaScript.

Goodnight.
__________________

Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.
Skyzyx is offline   Reply With Quote
Old 04-17-2003, 06:50 AM   PM User | #4
lil_drummaboy
New to the CF scene

 
Join Date: Apr 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
lil_drummaboy is an unknown quantity at this point
yes, i realized my topic mistake after i posted. I have actually seen a few script that do this, minus the port, but didn't work. I could use php but I want to see If there is any better way that I can still use in HTML.
lil_drummaboy is offline   Reply With Quote
Old 04-17-2003, 08:10 AM   PM User | #5
Mhtml
Senior Coder

 
Mhtml's Avatar
 
Join Date: Jun 2002
Location: Sydney, Australia
Posts: 3,531
Thanks: 0
Thanked 1 Time in 1 Post
Mhtml is an unknown quantity at this point
Eh? Do you actually know what a server side language is? It returns Html (not always).
__________________
Omnis mico antequam dominus Spookster!
Mhtml is offline   Reply With Quote
Old 04-17-2003, 09:59 AM   PM User | #6
ionsurge
Senior Coder

 
Join Date: Aug 2002
Location: A 4D universe
Posts: 1,337
Thanks: 0
Thanked 0 Times in 0 Posts
ionsurge is an unknown quantity at this point
Let me guess you are trying to do that stuff that you get saying what IP and OS you are using, to make you get some software you actaully have no need for, as you already do have one of the best firewalls out there.


Anyway this is in the wrong forum.
__________________
http://www.mudsplat.com - Web design, print, and marketing solutions.
ionsurge is offline   Reply With Quote
Old 04-17-2003, 03:07 PM   PM User | #7
jalarie
Regular Coder

 
Join Date: Jun 2002
Location: Flint, Michigan, USA
Posts: 593
Thanks: 1
Thanked 19 Times in 19 Posts
jalarie is an unknown quantity at this point
I use an img tag to pull something that I know exists from my target, and JavaScript to pull something from my own machine if the img from the target fails. Maybe you could build from this:

<script type="text/javascript">
&nbsp;Now=new Date();
&nbsp;Out ='<img src="http://target.com/green.gif';
&nbsp;Out+='?'+Now*1;
&nbsp;Out+='" onerror="this.src=\'red.gif\'"/>\n';
&nbsp;document.write(Out);
</script>
__________________
Visit my site at http://spruce.flint.umich.edu/~jalarie/.
jalarie is offline   Reply With Quote
Old 04-17-2003, 03:14 PM   PM User | #8
beetle
Senior Coder

 
Join Date: Aug 2002
Posts: 3,467
Thanks: 0
Thanked 0 Times in 0 Posts
beetle has a little shameless behaviour in the past
That will never let him ping an IP and see if it responds.

Sorry, Javascript just doesn't have the capacity for this task.
__________________
My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
“Minds are like parachutes. They don't work unless they are open”
“Maturity is simply knowing when to not be immature”
beetle is offline   Reply With Quote
Old 04-17-2003, 03:19 PM   PM User | #9
jalarie
Regular Coder

 
Join Date: Jun 2002
Location: Flint, Michigan, USA
Posts: 593
Thanks: 1
Thanked 19 Times in 19 Posts
jalarie is an unknown quantity at this point
beetle, you are correct that my code is not a general solution to the problem. But, if he knows an image file that should be returned when the server at that address and port is working properly, then he could still get an indication of whether it is up or down.
__________________
Visit my site at http://spruce.flint.umich.edu/~jalarie/.
jalarie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:56 AM.


Advertisement
Log in to turn off these ads.