Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot bsod computer connection crash css dell display driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound spyware trojan usb video virus vista windows windows vista windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
html post ip on webpage


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
jackdw's Avatar
Computer Specs
Senior Member with 1,722 posts.
 
Join Date: Jul 2005
Location: UK
Experience: Advanced
16-Aug-2007, 11:30 AM #1
html post ip on webpage
I run a small server for me and my friends. It usually runs counter strike.

Problem:
I have a dynamic IP and the router disconnects a lot.

I have a no-ip account and I was wondering, if I ran a webserver on the server and people went to my URL, is there a way some code could display the server's external IP address so they know what the IP is of the server to join?

I hope I make sense
Thanks
Jack
__________________
"There's no such thing as a stupid question"
Except perhaps for this:
"I want Windows me off of my system. There is no unistall for windows me in my Add/Remove programs."
Duckman69's Avatar
Computer Specs
Senior Member with 642 posts.
 
Join Date: Jun 2007
16-Aug-2007, 11:44 AM #2
so your saying the ip they need to connect on is based on your ip because the server for whatever is a program that bases that info off your ip and other info... so if your ip changes so does there server address, and you want them to be able to check it to see what its current address is from now on?... i hope i understood that part right... also i dont think you can do that i may be wrong though ... no way to get that ip to stay manual & locked as is? then just post the ip info of the set ip after that...
jackdw's Avatar
Computer Specs
Senior Member with 1,722 posts.
 
Join Date: Jul 2005
Location: UK
Experience: Advanced
16-Aug-2007, 11:56 AM #3
That's exactly what I want duckman.
I know people can ping the no-ip address in cmd but some people aren't that computer proficient, and it's a pain.
Duckman69's Avatar
Computer Specs
Senior Member with 642 posts.
 
Join Date: Jun 2007
16-Aug-2007, 12:30 PM #4
alright, no way to set a perment ip for your pc then? how does that ping no-ip thing work i mean if you have a dynamic ip and its always changing hows that work im unfimiliar with this a bit myself... if you can do it threw command tho theres probally a web command as well, maby some1 else on the forums will know of it...
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,187 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
16-Aug-2007, 06:04 PM #5
If your site runs PHP, you can do this:

PHP Code:
<?php echo $_SERVER['SERVER_ADDR']; ?>
That will tell you the IP address of the server.
jackdw's Avatar
Computer Specs
Senior Member with 1,722 posts.
 
Join Date: Jul 2005
Location: UK
Experience: Advanced
16-Aug-2007, 08:21 PM #6
Duckman. no-ip is a server (noip.com) that offers URL's for people who have a dynamic IP address (ie, IP changed every time a connection is made) a way to find their IP address anywhere.
Mine, for instance is jackdw.no-ip.info and if you were to type that into remote desktop connection, you will be faced with the login screen to my server. noip replaces the need to remember an IP or have to worry about the router disconnecting and issuing a different IP address when you are running a website or wanting to access your PC via remote desktop.

Namenotfound, the site doesn't exist yet but I will install a php/mysql webserver (apache). What do I do with that code?
__________________
"There's no such thing as a stupid question"
Except perhaps for this:
"I want Windows me off of my system. There is no unistall for windows me in my Add/Remove programs."
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,187 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
16-Aug-2007, 08:23 PM #7
Quote:
Originally Posted by jackdw
Namenotfound, the site doesn't exist yet but I will install a php/mysql webserver (apache). What do I do with that code?
Just put it in the page, make sure the page has a .php file extension. For example "mypage.php" instead of "mypage.html"

It will work as soon as you paste it in. Just paste it where you want it to show up, where ever you put it, on the page you'll see xxx.xxx.xxx.xxx (but with actual numbers, that's the IP address for the server)
__________________
-----------------------------
| 404: Name Not Found |
-----------------------------
PLEASE NOTE: If I happen to help you in a post, or just simply reply to it, doesn't mean I want to be bombarded with PMs. I answer all questions in posts, not in PMs. Thank you, and have a good day.

<?php $h = 'Hello '; $w = 'World'; echo $h.$w; ?>

My Favorite Editors:
Windows: Crimson Editor
Mac: Taco HTML Edit
Linux: gPHPEdit
jackdw's Avatar
Computer Specs
Senior Member with 1,722 posts.
 
Join Date: Jul 2005
Location: UK
Experience: Advanced
16-Aug-2007, 08:49 PM #8
Problem:
I just tried it on a webserver I have access to and it shows it's internal 192.168 address rather than the external IP...
Squashman's Avatar
Distinguished Member with 12,688 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
16-Aug-2007, 11:08 PM #9
Quote:
Originally Posted by jackdw
That's exactly what I want duckman.
I know people can ping the no-ip address in cmd but some people aren't that computer proficient, and it's a pain.
Then create a batch file or VBscript for them to run to ping your Domain Name and return the IP address.

And I guess I am kind of confused on why they need the IP address to connect to your server. What is wrong with just using the domain name. Kind of the whole point of DNS.
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
Duckman69's Avatar
Computer Specs
Senior Member with 642 posts.
 
Join Date: Jun 2007
17-Aug-2007, 09:09 AM #10
thanks for the info jack i kinda new 1/2 that but was confused on some of it appreciate it
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,247 posts.
 
Join Date: Oct 2006
17-Aug-2007, 01:23 PM #11
Quote:
Originally Posted by jackdw
Problem:
I just tried it on a webserver I have access to and it shows it's internal 192.168 address rather than the external IP...
When I go to http://jackdw.no-ip.info it prompts my for the login information of your router.
jackdw's Avatar
Computer Specs
Senior Member with 1,722 posts.
 
Join Date: Jul 2005
Location: UK
Experience: Advanced
17-Aug-2007, 02:28 PM #12
MMJ, that would be because I am yet to forward port 80 to the server as I am still setting up the game server with a friend. If you were to try it in remote desktop when the server is on, you will get a login screen because port 3389 is forwarded.

Squashman, for some reason I don't think the program that connects the games (steam valve) accepts anything other than numbers and dots in the IP address box. I may be wrong and I cannot test it myself as I am on the same network and have to connect by using 192.168.x.x
__________________
"There's no such thing as a stupid question"
Except perhaps for this:
"I want Windows me off of my system. There is no unistall for windows me in my Add/Remove programs."
namenotfound's Avatar
Computer Specs
Distinguished Member with 2,187 posts.
 
Join Date: Apr 2005
Location: New York
Experience: I know what I know, I am
17-Aug-2007, 06:08 PM #13
Quote:
Originally Posted by jackdw
Problem:
I just tried it on a webserver I have access to and it shows it's internal 192.168 address rather than the external IP...
The IP is internal because you didn't set the server up to be accessed from an outside source yet. I'm assuming that's what it is.
jackdw's Avatar
Computer Specs
Senior Member with 1,722 posts.
 
Join Date: Jul 2005
Location: UK
Experience: Advanced
17-Aug-2007, 06:52 PM #14
The server I tried it on has a load of ports forwarded to it.
80
21
3389
2800
2900

Surely port 80 would make it display the external IP...
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,705 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
17-Aug-2007, 07:50 PM #15
Quote:
Originally Posted by jackdw
The server I tried it on has a load of ports forwarded to it.
80
21
3389
2800
2900

Surely port 80 would make it display the external IP...
Port forwarding won't do the trick. I'm with Squashman on this. Using the domain name is the key. So, maybe using PHP to do a DNS lookup on jackdw.no-ip.info will return an IP address that can then be posted on the webpage?

EDIT: Looks like using the PHP function dns_get_record() will do the trick.

Peace...
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:26 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.