Remote IP Address ($_SERVER) Wrong

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.



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

Here is the example:....

View 1 Replies View Related

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 View Related

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 View Related

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 View Related

Wrong Sender Address In Mail()?

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

PHP 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 View Related

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 View Related

$_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 View Related

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 View Related

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 View Related

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 View Related

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 View Related

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 View Related

$_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 View Related

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 View Related


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 View Related


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 View Related

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 View Related


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 View Related


What is the difference between:


View 3 Replies View Related

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 View Related


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 View Related


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 View Related


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 View Related

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 View Related

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 View Related

Use A Script That Has A Mail() Function And The Address Is To An Address Of The Same Domain As The Site

I just moved my php site to a new host. The previous host and the new one are both running the PHP 4.3.11. The sendmail path is the same.

If I use a script that has a mail() function and the address is to an address of the same domain as the site, it works ok. If it is to an outside address, it disappears. Though it returns it was a successful send.

View 1 Replies View Related

Detect If The IP Address For Data Received Via A Web Form Has Come From A Spoofed IP Address?

How do you detect if the IP address for data received via a web form has come from a spoofed IP address? If detection is possible in PHP, is there a library that will also attempt to find the real IP address?

View 1 Replies View Related

Ftp - Transfer Files From Local Machine To Remote Server With The Script Residing On Remote Server

Is it possible to transfer a file from local machine to a remote server if the php script (say using ftp functions ) resides on a remote server?. I heard it might take to set up the local machine as a FTP server and the local machine should have a static IP address.

I am looking for directions as to how to set up the local machine to be a ftp server?., or is there any other way with php other than the form file upload($_FILES) thing ?.

View 2 Replies View Related

Mail() Bounces To Server Address Instead Of From Address

All email sent from php mail() that bounces is being returned to my servers admin email address instead of the "From" or "reply-to" address.

What needs to be put in my header code to ensure that this does not happen?

View 1 Replies View Related

Avoid Changing The Address In The Address Bar?

This is Praveenkumar. I have one doubt with the address bar.I creating a website. Something like this http://localhost/Website/index.php is the starting page.If i give .../Website/home.php it goes to that page. So i think it is not good for the website.If anybody can goes to any of the page they know the address. So i want to block the change of address in the address bar. Please any one help that if someone give the .../home.php address it should not move to the page but it shows only the index.php as the default page.So plz help me for this and send me the codings through my mail id

View 7 Replies View Related

Copyrights 2005-15, All rights reserved