473,395 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to trap ip addresses

i want to learn some programming. and i need to know how to trap ip addresses. ill see people saying type this php code and stuff, and not only do i not know what that code is, i dont know what screen i would go to type it. the starting point for where u go to type codes etc would be helpful. do i need anything special for this?
Oct 21 '07 #1
3 1702
pbmods
5,821 Expert 4TB
Heya, dunce1000. Welcome to TSDN!

I went ahead and changed your thread title so that other members will actually take your question seriously.

Logging IP addresses is a server-side task, so you'll need to use a server-side language, such as PHP, to accomplish it.

Search Google for a PHP tutorial to get started. There's a good one here.
Oct 21 '07 #2
thank you. the reason for my title was that i wanted to make it clear that i was a neophyte and so i would be spoken to on very basic terms.

thanks for the site. i will try to make some sense out of it.

i dont even know what a server side is.

and if i was using something like this tool. where to operate it from. right in lotus notes, a word document, or dos? what screen do i need to find?
Oct 21 '07 #3
pbmods
5,821 Expert 4TB
Heya, dunce1000.

In a nutshell, here's how the web works:

When you type an address into your web browser's address bar, your computer sends out a request. Long story short, the server located at that 'address' receives the request an processes it.

So for example, when you type:
Expand|Select|Wrap|Line Numbers
  1. http://www.google.com/search?q=hello,+world
  2.  
You are sending a request for '/search?q=hello,+world' to the 'www' server located at 'google.com'.

Incidentally, as part of that request, your browser also sends your IP address with the request so that (in this case) Google knows where to send the response.

Now then. In order to perform the search, Google has to run a program to access its massive database. Because it is executing this code on the server, and not in your browser at home, this is known as 'server-side' code.

Once the search program finishes executing, Google takes the results and turns it into an HTML page and sends it back to your computer.

Your computer evaluates the HTML and displays the pretty webpage with the goofy Google logo... and your search results.

While your browser is parsing the HTML, it also evaluates JavaScript and other 'client-side' scripts (that is, anything that your browser runs instead of the server).


In order to capture the IP address of requests to your website, you need to be able to write to some kind of file *on the server* so that you can keep track of them (if you were to try to save a record of the IP address on the User's browser, how would you retrieve it later to generate a report of all the IP addresses that accessed your site?).

Hence, you'll need to use a 'server-side' language.

Server-side scripts, such as index.php or contact_us.asp are files on the server just like title.html or wellImSureYouGetTheIdea.txt.

When you request an '.html' or '.txt' file, the server takes whatever's in that file and sends it directly to your browser.

On the other hand, when your browser sends a request to a server for a '.php' or '.asp' file, the server first runs the script through a special interpreter, and then it sends *the result* to your browser instead.

Here's a very basic example.

Let's say you had a file on the server called 'hello.txt'. It contains a single line:
Expand|Select|Wrap|Line Numbers
  1. Hello, World!
  2.  
When the server receives a request for hello.txt, it loads the content of that file ('Hello, World!') and sends it to the browser.

Now let's look at a simple PHP file, called 'hello.php':
Expand|Select|Wrap|Line Numbers
  1. <?php echo 'Hello, World!'; ?>
  2.  
When the server receives a request for hello.php, it loads the content of that file, and then it runs that code through the PHP interpreter and then it passes the result (which happens to also be 'Hello, World!') to the browser.

With that in mind, the general flow of development for an IP address logger would be:
  1. Configure your server to execute PHP scripts. In the case of professional hosting, this step may already be done. In the case of using your own computer, you may have to install and set up PHP yourself (but we'll be happy to help you out ^_^).
  2. Create a PHP script that logs the IP address.
  3. Turn your HTML pages into PHP scripts so that you can include the script that logs the User's IP address at the top of them.

To solve step #1, we first need to know your server setup. Is your website on the internet now? Do you have your own server? Is it professionally hosted (i.e., are you paying some company on the west coast to host your site, or is your friend hosting the site from a computer in his basement)?
Oct 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Hoang | last post by:
anyone know of an algorithm to filter out real email addresses as opposed to computer generated email addresses? I have been going through past email archives in order to find friends email...
3
by: Grytpype-Thynne | last post by:
Can anyone point me in the direction of a cross browser way of displaying two addresses side by side after some preliminary text? I have tried a containing box and floating two further boxes...
2
by: Not Me | last post by:
Hi, I've been having this problem for a while now and seem to be getting closer to a solution but it's still not perfect. I have a table of addresses, people (refno's) may have more than one...
2
by: (Pete Cresswell) | last post by:
For better or worse, I have chosen to implement mailing addresses in a particular application as a separate table. One Person ==> Many Addresses. It is a database for managing school reunions...
11
by: pemo | last post by:
Ambiguous? I have a student who's asked me to explain the following std text (esp. the footnote). 6.2.6.1.5 Certain object representations need not represent a value of the object type. If...
10
by: pemo | last post by:
As far as I understand it, a trap representation means something like - an uninitialised automatic variable might /implicitly/ hold a bit-pattern that, if read, *might* cause a 'trap' (I'm not...
1
by: Lyle Fairfield | last post by:
Option Explicit ' requires VBScript to be installed ' (maybe don't give this to your sugnificant other as ' it gets deleted addresses as well as current) ' obvious fixups needed '1. how get...
6
by: temper3243 | last post by:
Hi Can someone explain me what is happening below ? Why is it printing 401380 $ cat scanf.c #include<stdio.h> int main() { int i; scanf(" %d",&i);
4
by: =?Utf-8?B?U2VyZ2Vp?= | last post by:
Dear staff Can I get your assistance with \3GB (LARGEADDRESSAWARE) switch in mixed mode process built by VS 2008, please? I have a mixed mode application: C# GUI calling native C++ DLL through...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.