Remote IP Address ($_SERVER) Wrong

Feb 24, 2007

I need to know the remote IP of users to a chatroom I manage here to log troublemakers.

I found the function: $_SERVERREMOTE_ADDR or alternatively $_SERVER["REMOTE_ADDR"]

the strange thing is: when displaying the remote address in the room each user sees his/her correct IP but I myself see _always_ only the address of my site (fixed IP behind a French "livebox" DSL modem). I could understand that I internally to my network see that address as that "livebox" also does the WiFi for the whole house but not the external users who, as mentioned, see the correct IPs themselves.

View 1 Replies



I'm facing a weird problem for $_SERVER["REQUEST_URI"]

Here is the example:....

View 1 Replies

Get An IP Address Using $_SERVER ['REMOTE_ADDR']

so I know how to get an IP address using $_SERVER['REMOTE_ADDR'], however, I need to get an IP a little different. How would I get the IP of the visitor on a remote site loading MY site using file_get_contents()? It just returns that remote websites server IP...

View 7 Replies

Get Wrong IP Address ?

i have following php code to get vistor ip

function VisitorIP()

how can i get exact internet IP & system IP addressbecause my script will run on LAN nwteork and i want to record IP of lan pcs & internet IP and save it in mysql database.i need PHP code which privide local system IP and system internet IP.

View 2 Replies

Ip Address - Alternative To $_SERVER['REMOTE_ADDR'] ?

Is there any alternative to the $_SERVER['REMOTE_ADDR']. Which returns the ip address of the computer accessing a site.I'm trying to search about same external ip assigned by router, and got into this:How do two computers connect to same external address through NAT?And found out that the same external ip is assigned if the computers are connected to the same modem.I'm creating a simple login program in php which uses $_SERVER['REMOTE_ADDR'] to determine if a user is already logged in somewhere else in the same network. And this won't actually work if those computers are connected to the same modem through the router.

View 2 Replies

Wrong Sender Address In Mail()?

I've tried sending an email the following php script:

PHP Code:


$to = '***@***.net';
$subject = 'test';
$message = 'Test';[code]....

The problem is that the received e-mail does not contain any of the headers specified. Here's the raw source of the received mail:


Return-Path: <_www@***.lt>
Received: from ip***.lt [] by Mail53.***.com with SMTP;
Mon, 2 Nov 2009 08:48:25 -0500[code].....

View 2 Replies

Find IPV6 Address Similar To $_SERVER['REMOTE_ADDR'];

Is it possible to use PHP to find out peoples IPV6 address similar to $_SERVER['REMOTE_ADDR'];

View 4 Replies

$_SERVER['HTTP_REFERER']; That Will Display The Full Address Path.

Which predefined variables is it that will let me just echo the domain of the person who is visiting referred from? I know I can do this:

$_SERVER['HTTP_REFERER']; but that will display the full address path. I want to only be able to see this: I used to know how to do this; but I have forgotten how. Any body remember which predefined variable this is?

View 2 Replies

Apache / Assume That $_SERVER['REMOTE_ADDR'] Always Returns A IPv4 Address?

Is it safe to assume that $_SERVER['REMOTE_ADDR'] always returns a IPv4 address?

View 1 Replies

Get Remote MAC Address

Is there any way to get the MAC Address of the user that is visiting a certain page? Not necessairly his computer's MAC. which i know it is not always possible if not directly connected to the internet. Anyways, I've tested some scripts that I googled: nothing.

View 1 Replies

Getting The Remote Address From A <script> Tag?

I have a page with a tag in it pointing to a php script that generates javascript.

In this php script, I verify the remote ip to see if this ip has the right to use the script.

My question is: how do I get the IP from the machine that embeds the tag?

In $_SERVER, I have REMOTE_ADDR which is MY ip address (the client) and SERVER_ADDR which is the ip of the machine that runs the php script that generates javascript (the server).

But in between those, there's the page that embeds the tag and I need its server IP address.

View 2 Replies

Selecting Which IP Address To Use When Connecting To A Remote

I have a machine with multiple IP addresses and I want to select the IP
address used by my script when it connects to another location. Does
any one know a way to select which IP address to use when creating a
connection ?

View 4 Replies

Remote Address Parameter In Zend_Http_Client?

Am developing a public site that uses the Zend_Http_Client to access remote logic.Is there a property/way in the Client adapter that I could set the remote address of the user browsing the site?

Currently am using this workaround which combines both remote address and remote useragent.

$client = new Zend_Http_Client();
'useragent' => 'Get Remote Address'.'Get User Agent',

Is there a specific property for remote address?

View 1 Replies

$_SERVER["SERVER_NAME"] Returns Some Ip Address?

as far as I know $_SERVER["SERVER_NAME"] and $_SERVER["REQUEST_URI"] returns the server address like http:[url]....

But some cases, $_SERVER["SERVER_NAME"] returns an ip address like and $_SERVER["REQUEST_URI"] also returns the ip address with port like

View 1 Replies

Don't Get Error Message If Login Name Is Wrong, Just Blank Div, But I Can Detect Wrong Password If Username Is Correct?

I don't get error message if login name is wrong, just blank div, but I can detect wrong password if username is correct.

<html lang="en" >

View 1 Replies


Is there a way to use opendir() using some sort of absolute path?
I want a file to open the same directory on my site, no matter from what directory it is called.

For example, I have the following variables, but no combination seems to work for me.

Q: Does opendir() ONLY deal with relative paths?
Q: If opendir() works with absolute path, am I missing something?PHP Code:

View 1 Replies


I'm on HostMonster and I'm trying to setup cron to play nicely with a Drupal install I have running and I'm running into problems trying to code for a condition that says, "IF I'm the server and I'm making the request to do CRON, then do the following..."Basically (in layman's terms), I'm having a hard time trying to figure out how I should code for cron requests from the server, which brings me to the following questions:1.) Do cron jobs always execute from the host server? For example, if $_SERVER[SERVER_ADDR] is always "", does this mean that the 583 bytes sent for cron jobs always come from the same IP address or are there exceptions to this? The reason I ask this is because I have a poor man's byte counter in this cron code I'm working with that sets up a file read and keeps you in the reading loop until the byte count reaches 583 (which, according to my IP logs, is the number of bytes sent with each cron "ping" that gets made.) The code isn't firing, however, because I'm having a hard time making the code run from either cron requests or else from an inconsistency between the IP comparison code I have.2.) Before any cron code gets executed, I have "ignore_user_abort(true);" called at the beginning of the page. Will this effectively process all proceeding code thereafter if cron pings the page? In other words, will using this make the page get processed as if someone traveled to the cron.php page in their browser?

View 7 Replies

Setting A $_SERVER Value ($_SERVER['something']) Using Apache .htaccess?

Is it possible using .htaccess or other apache powers to set a custom server value in the php array $_SERVER.

for example
if($_SERVER['is_special']) {
echo "Yeah for us!";
} else {

I realize I ask a lot of questions that the answer is no so feel free to say so.

View 2 Replies


what's the difference between them? how to use them. i print_r($_SERVER). there is no result of $_SERVER['PATH_INFO'] and $_SERVER['PORIG_PATH_INFO'] .why? how to enable it.i have read the php manual on them, but still don't understand them.

View 2 Replies


What is the difference between:


View 3 Replies

Controller Structured Wrong Way / Code In Wrong Place?

I've fairly new to PHP MVC and I'm not 100% sold I'm doing this in the most logical way possible. This is a piece of code from one of my controllers. friend said a majority of this code should be moved into the Model? Is this so? Right now I have a DataAccess layer that does all the SQL work. For User work I have a UserDataAccess object, which will create, update and delete. It appears I'm using something along the lines of the Data Mapper pattern. My Model classes map directly to the database columns on a given table and that's it. I'm continually confused at where each piece of code should go.


View 3 Replies


If i need to fix the page name from which the click was originated, what is better to fix: $_SERVER['PHP_SELF'] or $_SERVER['HTTP_REFERER']? I mean the click to an external resource.

View 1 Replies


I simply love this site! Hope you all have a great Christmas holiday, and wish everyone have a prosperous 2010!

Anyway, I have a quick question regarding the global variables

View 5 Replies


what's the difference between them? how to use them. i [ICODE]print_r($_SERVER).[/ICODE] there are no result of $_SERVER['PATH_INFO'] and $_SERVER['PORIG_PATH_INFO'] .why? how to enable it.i have read the php manual about them, but still don't understand

View 1 Replies

Script - Increments IP Address From Defined Starting Address To Defined Ending Address?

I know I can do this easily by converting the IP addresses to decimal notation first using PHP built in functions like up2long and long2ip. I just want to be able to do the same using the standard IP address notation as an exercise. The problem I am thinking goes like this: Given an starting IP address, say, and an ending IP address, say Make the program that prints all the address numbers in that range (,, … ,,

I was thinking that maybe the way to go would be to make a nested for loop inside a while condition until the first octet of the starting address matches the first octet of the ending address. Then execute the same block of code for the second octet and so on until the program reaches the ending address and finished. I just started learning to program recently so it is quite possible that my of thinking and or writing code is far from elegant. If you were to this, how would you do it?

View 2 Replies

Implement Form Validation Part In Shopping Cart Such As Email Address / Age / Address?

i need to implement form validation part in my shopping cart such as email address , age, address and etc. how to validate email address and other forms ? what are the implicit functions in php for validation?

View 12 Replies

Copyrights 2005-15, All rights reserved