yoofus
Mar 26 2005, 09:57 AM
| | In this simple tutorial I will explain how to show a users IP address in your website statistics.
Open the file you would like to show the IP in, and insert this code where you want it to show:
CODE <?php echo $_SERVER["REMOTE_ADDR"]; ?>
An IP Address whould show up. If you would like to have text infront of the IP, for example, IP Address: Blah Blah. Type:
CODE IP Address: <?php echo $_SERVER["REMOTE_ADDR"]; ?>
Make sure to save the file as '.php' format, otherwise the code will not work. |
Reply
maddog39
Mar 26 2005, 07:46 PM
Well thats nice and easy for the n00bs, lol. However an alot better cleaner way of doing it is like this... [CODE] <?php $ip = getenv('REMOTE_ADDR'); echo "<p>IP: $ip</p>"; ?> then with that way you can also do thing like HTTP_USER_AGENT or HTTP_GET_VARS all in one variable/function. Make sense?
Reply
yoofus
Mar 26 2005, 07:51 PM
I know maddog, but this tutorial was for beginners!
Reply
maddog39
Mar 26 2005, 08:24 PM
I know. However there is still an even easier way of doing it than that. Just go... CODE <?php echo "IP: $REMOTE_ADDR"; ?>
Thats even shorter.
Reply
yoofus
Mar 26 2005, 08:44 PM
Thanks, I didn't know about that way. You get a reputation point for helping me
Reply
maddog39
Mar 26 2005, 09:39 PM
No problem, your always welcome as everyone is.  Thanks for the rep point too.
Reply
Recent Queries:--
show ip-address php code - 11.62 hr back.
-
php user ip display text - 14.74 hr back.
-
php user ip address - 20.42 hr back.
-
php user ip address - 15.16 hr back.
-
php echo user ip - 25.66 hr back.
-
php get user ip address - 19.18 hr back.
-
php get ip address of user - 7.60 hr back.
Similar Topics
Keywords : showing users ip address php- How To Disable Firefox's Awesome Bar
- restore old location/address bar from firefox 2 (4)
- How To Control Other Users’ Privileges (microsoft Windows Steadystate 2.5)
- (1)
Recently Microsoft has developed a program that makes user control easier. The program is called
Windows SteadyState 2.5 and it needs a genuine version of windows. System Requirements
• Supported Operating Systems: Windows Vista Enterprise; Windows Vista Home Premium; Windows
Vista Ultimate Windows XP Professional, Windows XP Home Edition, Windows XP Tablet PC Edition with
Windows XP Service Pack 2 (SP2) installed or Service Pack 3 (SP3) installed, Windows Vista Business,
Windows Vista Home Basic, Windows Vista Starter, or Windows Vista with Servi...
Verifying Your Email Address
- A Simple PHP Tutorial. (0)
Hi, everyone. I'm offering the next PHP tutorial that verifies an email address of an user who
wants to register on your site. This is how it works. When someone, went to registration page and
filled out all of the details such as Name, Password, email and so on and submit those details to a
server. The user is getting unique registration code to his or her email account, the one has to be
clicked to activate the account. 1. Outline: a) You need to create or build the following files:
-config.php (The configuration file) -signup.php (Initial Registration) ...
Opening Nat On Your Xbox - Upnp With Netgear
- for NETGEAR users with UPnP enabled (0)
I think all of the NETGEAR Routers now come with UPnP Follow this tutorial and i will show you how
to open your NAT. 1. Go to 192.168.1.1 (or 192.168.0.1 - or whatever they supplied you with) 2. Go
down to maintenance and 'Attached Devices'. 3. My xbox is named '---' - most xboxes
have that default name. 4. Make sure your xbox is located there and is in the IP you selected in
your xbox wifi setup. 5. Now go down to 'Advanced' then 'UPnP' 6. If the
'Turn UPnP On' is toggled - then uncheck it and apply. Then when it update...
Dynamic Signature - Yet Another Way To Do It
- Create dynamic sigs for multiple users using .htaccess and RewriteRule (0)
Ever since I connected a program I made in Visual Basic to MySQL database, I had an idea to create
some sort of a status page... And I did that, where I updated my connection status every 60 seconds,
updated my Winamp playlist, and several other interesting things... Then, I figured I could create
an image, and display all that info, and show it on forums, as a signature... And I made a great
PHP script, that look real fancy, and does the job perfectly... So, I was adding the reference to
http://status.galahad.trap17.com/stat.php to all the forums... BUT (there's ...
How To: Have Opera Check C-panel Webmail
- Geared toward Trap17 users (1)
This tutorial is valid for Opera 9 or above; but previous versions might work. In the menu bar,
go to Tools > Mail and chat accounts... Click on Add... Make sure Regular e-mail
(POP) is selected. (It should be by default.) Click Next > . In this section, you see three
fields: Real Name , E-mail address , and Organization . Organization is
optional. Type in your name in the Real Name field, and your account's e-mail in the
E-mail address field (syntax: cpanel_username@your_subdomain.trap17.com). Click Next...
Asking Users To Confirm If They Wish To Leave The Page
- (5)
I am sure all of us have had the frustration of having to retype an entire email from scratch
because we accidentally hit "back" or otherwise left the page. As web technology improves and
becomes more profound, such problems have found their simple solutions, as displayed by Google on
Gmail, Google Calendars, Google Pages, Blogger etc. This tutorial will explore this script used to
prevent a user from leaving the page accidentally. In order to achieve this, make sure your users
have Javascript enabled. We will be using window.onbeforeunload. Firstly, open up your HTML ...
Building An Address Book With Java
- (1)
Dear Friends I am sharing a java program with all of u which I built a few years back. I guess it
will help beginners. It uses java utill package to store data in a flat file. The File
Name-----phone.java import java .io .*; import java .util .*; import java.awt.event.*; public
class phone { public void new_record() { String id,name,city,add,number,total,list;
boolean bln=false; try { Properties pr=new Properties(); FileInputStream
fin=new FileInputStream("phone.dat"); if(fin!=null) { pr.load(fin); }...
Configuring Dns Settings For Website
- Nameserver, A-Address, DNS configuration (1)
Most of the people have problems configuring their website. After registering their domain, many get
confused in configuring their domain (basically the DNS settings). This small tutorial will help you
get started with DNS settings configuration. A domain can be basically pointed to a server using 2
main techniques. 1. Nameserver (the most recommended way) 2. A Address (Not recommended)
Configuring using Nameservers ==================== Login to your domain Control panel provided by
your DOMAIN NAME PROVIDER / REGISTRAR. Not your webhost. Search for settings like DN...
Who's Viewing My Site?
- Targeted for AIM users (11)
As some of you may know, I asked a question on how to get a portion of the URL in the address bar
and save it, and thanks to several sources*, I have successfully learned how to do that. Today, I
will share with you, step-by-step, my knowledge. The object of this tutorial is to mimic a
feature on many subprofiles where you're able to see the AIM screennames of people who viewed
your site. Note : The URL that I will be using extensively throughout this tutorial is
http://yoursite.trap17.com . This is not a special URL reserved on trap17 but is merely a represe...
Excluding Your Site From Showing Up On Search Engines
- Or how to prevent stalkers from finding your personal site. (0)
Firstly, I suppose there are very few people here who would want to do this. Most people want
their sites to be listed on search engines, and these are probably the ones thinking that I must
have a loose screw or something. But if you use your site for personal blogging and want to keep it
open to friends and yet prevent your privacy from being infringed upon, this is worth looking at.
What you need: 1. A text editor. Notepad works fine for me. 2. Coffee. (Not because you're going
to stay up all night, but because I like to drink coffee for any and every reason po...
Looking for showing, users, ip, address, php
|
|
Searching Video's for showing, users, ip, address, php
|
advertisement
|
|