Lost Password?

  #1 (permalink)  
Old 10-29-2007, 12:34 AM
Jaan's Avatar   
Jaan Jaan is offline
Moderator
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 426
Last Blog:
Wadio Media Layout Com...
Rep Power: 9
Jaan will become famous soon enoughJaan will become famous soon enough
Send a message via MSN to Jaan
Default Check your IP

HTML Code:
<html>
<head>
<script language="JavaScript">
function disp_ip(){
var ip = '<!--#echo var="REMOTE_ADDR"-->';
document.write(ip)
}
</script>
</head>
<body>
<form>
<input type='button' value='Check your Ip' onClick='disp_ip();'>
</form>
</body>
</html>
But you have to use .shtml extension not .html or .htm because it uses server side includes
__________________


Cheap & Professional Web Design | Need help? Send a PM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-18-2008, 07:10 PM
DevilsCharm's Avatar   
DevilsCharm DevilsCharm is offline
Programming God
 
Join Date: Jul 2006
Posts: 875
Rep Power: 13
DevilsCharm is on a distinguished road
Default Re: Check your IP

Always good to have alternatives to ipchicken, ha ha.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-28-2008, 05:26 AM
chili5's Avatar   
chili5 chili5 is offline
Speaks fluent binary
 
Join Date: Mar 2008
Location: Canada
Age: 15
Posts: 1,224
Rep Power: 10
chili5 will become famous soon enough
Send a message via ICQ to chili5 Send a message via AIM to chili5 Send a message via MSN to chili5 Send a message via Yahoo to chili5
Default Re: Check your IP

Interesting, the only thing is your server has to have SSI enabled for this to work.

Is their anyway to do this if SSI isn't enabled? I do have SSI enabled but I'm just curious.
__________________
Success is the ability to go from failure to failure without losing your enthusiasm. ~ Winston Churchill
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-28-2008, 06:19 AM
v0id's Avatar   
v0id v0id is offline
Super Mod
 
Join Date: Apr 2007
Location: Denmark
Posts: 1,876
Last Blog:
CherryPy(thon)
Rep Power: 23
v0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to all
Send a message via MSN to v0id
Default Re: Check your IP

Yes, you'll need to have SSI enabled in order to use the SSI functionality. Most servers does have it as default though, so normally you don't have to mess with it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-28-2008, 06:26 AM
chili5's Avatar   
chili5 chili5 is offline
Speaks fluent binary
 
Join Date: Mar 2008
Location: Canada
Age: 15
Posts: 1,224
Rep Power: 10
chili5 will become famous soon enough
Send a message via ICQ to chili5 Send a message via AIM to chili5 Send a message via MSN to chili5 Send a message via Yahoo to chili5
Default Re: Check your IP

My server I needed to enable SSI first but it was possible.

Though looking at the code, I don't think you need the javascript do you?

Couldn't you just do this:

Code:
<html>
<head>
</head>
<body>
<!--#echo var="REMOTE_ADDR"-->
</body>
</html>
but on my computer, when testing it, the IP that is displayed is 127.0.0.1 which isn't my IP.
__________________
Success is the ability to go from failure to failure without losing your enthusiasm. ~ Winston Churchill
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 05-28-2008, 06:32 AM
v0id's Avatar   
v0id v0id is offline
Super Mod
 
Join Date: Apr 2007
Location: Denmark
Posts: 1,876
Last Blog:
CherryPy(thon)
Rep Power: 23
v0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to all
Send a message via MSN to v0id
Default Re: Check your IP

It's true that you don't need Javascript at all, but the advantage of using Javascript in this situation is that you can save the result in a variable, and eventually use it for various string operations.

About your IP: If you ran the script locally, it will most likely return localhost (127.0.0.1).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-28-2008, 03:10 PM
chili5's Avatar   
chili5 chili5 is offline
Speaks fluent binary
 
Join Date: Mar 2008
Location: Canada
Age: 15
Posts: 1,224
Rep Power: 10
chili5 will become famous soon enough
Send a message via ICQ to chili5 Send a message via AIM to chili5 Send a message via MSN to chili5 Send a message via Yahoo to chili5
Default Re: Check your IP

Yeah I guess that is true, you could edit the string without reloading the page, so I guess it is a good idea to use JavaScript here.
__________________
Success is the ability to go from failure to failure without losing your enthusiasm. ~ Winston Churchill
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if a file exists? Lop Delphi/Python 3 01-07-2007 12:54 AM
How Do I check my HTML? skilletsteve HTML Programming 1 09-13-2006 11:12 AM
Check if a file exists Lop C and C++ 4 08-07-2006 10:03 PM
Best way to check if an object is null? dirkfirst Managed C++ 0 08-01-2006 07:29 AM
Check if a URL Exists Chan PHP Forum 1 07-13-2006 12:54 PM


All times are GMT -5. The time now is 04:03 PM.

Contest Stats

John ........ 87.50000
dargueta ........ 75.00000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads