Connect with Facebook Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Tutorials > PHP Tutorials

PHP Tutorials PHP Tutorials

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-22-2007, 09:46 PM
Jaan's Avatar   
Moderator
 
Join Date: Dec 2006
Location: Estonia
Age: 18
Posts: 1,518
Blog Entries: 4
Rep Power: 24
Jaan is just really niceJaan is just really niceJaan is just really niceJaan is just really niceJaan is just really nice
Send a message via MSN to Jaan
Default Check your IP

Well this is simple trick. Well i can't say it's a trick but.. well..

The way you see your IP

PHP Code:
<?php
echo $_SERVER['REMOTE_ADDR'];
?>

Last edited by Jaan; 01-17-2008 at 08:45 AM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-21-2007, 08:58 AM
Learning Programmer
 
Join Date: Oct 2007
Posts: 56
Rep Power: 0
twalters84 is an unknown quantity at this point
Default

Hey there,

Instead of outputting the IP address, you could store it in a variable and then get the hostname of the user.

PHP Code:
<?php
$hostname 
gethostbyaddr($_GET['ipAddress']);
echo 
$hostname;
?>
I had to use this on my coldfusion server because the host blocked the Java(CreateObject) method.

Sincerely,
Travis Walters
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-28-2007, 08:39 PM
Jaan's Avatar   
Moderator
 
Join Date: Dec 2006
Location: Estonia
Age: 18
Posts: 1,518
Blog Entries: 4
Rep Power: 24
Jaan is just really niceJaan is just really niceJaan is just really niceJaan is just really niceJaan is just really nice
Send a message via MSN to Jaan
Default

Quote:
Originally Posted by twalters84 View Post
Hey there,

Instead of outputting the IP address, you could store it in a variable and then get the hostname of the user.

PHP Code:
<?php
$hostname 
gethostbyaddr($_GET['ipAddress']);
echo 
$hostname;
?>
I had to use this on my coldfusion server because the host blocked the Java(CreateObject) method.

Sincerely,
Travis Walters
Well yea you can try it.. but it don't work always
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-28-2007, 09:16 PM
PlayaSkater's Avatar   
Learning Programmer
 
Join Date: Aug 2007
Location: Cruzer, US
Age: 18
Posts: 64
Rep Power: 0
PlayaSkater is an unknown quantity at this point
Default

What's the JavaScript method?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-29-2007, 12:32 AM
Jaan's Avatar   
Moderator
 
Join Date: Dec 2006
Location: Estonia
Age: 18
Posts: 1,518
Blog Entries: 4
Rep Power: 24
Jaan is just really niceJaan is just really niceJaan is just really niceJaan is just really niceJaan is just really nice
Send a message via MSN to Jaan
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-29-2007, 01:01 AM
PlayaSkater's Avatar   
Learning Programmer
 
Join Date: Aug 2007
Location: Cruzer, US
Age: 18
Posts: 64
Rep Power: 0
PlayaSkater is an unknown quantity at this point
Default

Thanks bro, you're awesome. How long have you been programming?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-29-2007, 08:12 AM
Jaan's Avatar   
Moderator
 
Join Date: Dec 2006
Location: Estonia
Age: 18
Posts: 1,518
Blog Entries: 4
Rep Power: 24
Jaan is just really niceJaan is just really niceJaan is just really niceJaan is just really niceJaan is just really nice
Send a message via MSN to Jaan
Default

np mate..
umm.. i think umm.. maybe 2,5 years for now ^^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-17-2008, 08:29 AM
Newbie
 
Join Date: Oct 2007
Location: Find-Ip-Address.org
Posts: 13
Rep Power: 0
deny is an unknown quantity at this point
Default

Quote:
Originally Posted by Jaan View Post
Well yea you can try it.. but it don't work always
If there is not any host name it will not works. Otherwise it will display host address.
So you can use both code!
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 My Blog Deathcry Site Reviews 7 01-14-2008 08:57 PM
Check if a file exists? Lop Pascal/Delphi 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


All times are GMT -5. The time now is 08:20 PM.

Freelance Jobs

XML/XSL: Need code for Book with Chapers using XML
Create an XML file for a book of your creation, and a basic CSS file that will format it to display ...
Earn: $40.00


C++/C: Simple firework cue sequencer
What I require is a rework of a simple cue sequencer. I have a piece of hardware (an Arduino boar...
Earn: $50.00


HTML/XHTML: Menu Rework - ASCIIBin
I'm placing this in the HTML/XHTML section of the Freelance site but you are not limited to HTML. Wh...
Earn: $20.00



CodeCall Goal

Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%

Ads