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.

ADVERTISEMENT

Apache Wrong $_SERVER[REQUEST_URI]

Nov 27, 2006

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']

Feb 24, 2011

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 ?

Jul 10, 2010

i have following php code to get vistor ip

function VisitorIP()
{
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
[code].....

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'] ?

May 12, 2011

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()?

Nov 2, 2009

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

PHP Code:

?php

$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:

Code:

Return-Path: <_www@***.lt>
Received: from ip***.lt [213.190.58.67] 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'];

May 15, 2007

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.

May 6, 2007

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:  www.domain.com. 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?

Apr 12, 2010

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

View 1 Replies View Related

Get Remote MAC Address

Jul 11, 2007

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?

Aug 13, 2010

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

Aug 4, 2006

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?

Jul 30, 2010

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();
$client->setConfig(array(
'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?

May 17, 2010

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 203.111.111.111 and $_SERVER["REQUEST_URI"] also returns the ip address with port like 203.111.111.111:25.

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?

Dec 23, 2010

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en" >
<head>[code]...........

View 1 Replies View Related

Opendir With $_SERVER['HTTP_HOST'] Or $_SERVER['DOCUMENT_ROOT']

Oct 20, 2003

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

Cron With $_SERVER[REMOTE_ADDR] And $_SERVER[SERVER_ADDR]

Mar 28, 2011

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 "123.123.123.123", 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?

Mar 4, 2009

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 {
[code]...

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

View 2 Replies View Related

Apache - $_SERVER PATH_INFO And $_SERVER PORIG_PATH_INFO'?

Apr 12, 2011

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

Difference Between: $_SERVER SCRIPT_NAME And $_SERVER PHP_SELF?

Jun 24, 2011

What is the difference between:

$_SERVER['SCRIPT_NAME']
and
$_SERVER['PHP_SELF']

View 3 Replies View Related

Controller Structured Wrong Way / Code In Wrong Place?

May 15, 2011

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.

[code]...

View 3 Replies View Related

$_SERVER['PHP_SELF'] Or $_SERVER['HTTP_REFERER']?

Jan 11, 2005

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

Get Value $_SERVER['REMOTE_ADDR'] And/or $_SERVER REMOTE_HOST?

Dec 28, 2009

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
$_SERVER['REMOTE_ADDR'] and/or $_SERVER['REMOTE_HOST']
[code]...........

View 5 Replies View Related

$_SERVER['PATH_INFO'] And $_SERVER['PORIG_PATH_INFO']?

Apr 11, 2011

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?

Dec 26, 2009

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 192.168.1.100, and an ending IP address, say 201.130.22.10. Make the program that prints all the address numbers in that range (192.168.1.100, 192.168.1.101, … , 201.130.22.9, 201.130.22.10).

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?

Apr 15, 2011

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

May 20, 2005

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?

Apr 14, 2010

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

Jun 17, 2011

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

Jun 24, 2005

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?

Jan 27, 2010

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

Capturing IP Address & Blocking IP Address?

Jul 1, 2009

I'm using a php script for my web site which has registration, log-in, etc. When I asked how I might be able to capture the registrants IP address upon registration, I was given this code and this advice:

Code:
$userip = $_SERVER[REMOTE_ADDR];
mysql_real_escape_string($userip);

"Remember when you store these values in the database to use these two functions INET_ATON() and INET_NTOA(). One is for inserting the IP and one is for extracting it." I don't know what INET_ATON() and INET_NTOA() are, but my goal is to be able to have a users IP address just in case he spams my site, then he can be blocked, based on the thinking that typically one user has one computer.

View 2 Replies View Related

Email Address Is Invalid Address

Aug 4, 2007

we are trying to use it andwe give it a perfectly valid "From address" and it comes back saying  the email address is invalid  address. Any ideas?

View 2 Replies View Related

User Inputs E-mail Address And Clicks Submit And E-mail Address Is E-mailed?

Oct 1, 2010

Created a simple submit form, where the user inputs their e-mail address and clicks submit and their e-mail address is e-mailed for use in a mailing list.For some reason it keeps giving the same error and won't actually send the e-mail doesn't seem to be a valid e-mail address.

Here's my code:<?php define('access', true); ?>
<?php
// Configuration

[code]...

We have an exciting new service to offer to our customers.We're not able to announce anything right now, but watch this space for updates in the very near future.Alternatively, enter your e-mail address below to be informed of any new services and offers we have.sell on e-mail address and won't receive any junk mail.

Code:<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<label>Be the first to hear about new services!</label>
<input type="text" size="35" name="mailinglist" id="mailinglist" title="Enter your e-mail address"/>

[code]...

View 3 Replies View Related

$_server

Jan 28, 2005

I am having trouble with this line:

<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" >

I get this error:

Parse error: parse error, unexpected '?'

View 1 Replies View Related

$_SERVER?

Jul 18, 2007

I have a file called index.php (localhost/blabla/index.php), and my mind has just gone blank and I cant remember how to get the file path without the file info... for example I need to get

localhost/blabla/

I am sure it is using $_SERVER but which argument =/

View 4 Replies View Related

$_SERVER[' ?? ']

May 13, 2007

if i go:
$homePage = $_SERVER['REQUEST_URI'];
i get:
home page = /indie/index.php?list=top

if i go:
$homePage = basename($_SERVER[PHP_SELF]);
i get:
home page = index.php

what i want is something in the middle:

home page = index.php?list=top

so it only shows the base script name, but also includes the parameters.

View 4 Replies View Related

$_SERVER Get Just The Url?

Mar 21, 2007

is there a way to get just the url?

for instance if I have an address such as Domain Name/Oilers/oilers.html

in every instance I do $path = $_SERVER['SCRIPT_NAME']; I get /Oilers/oilers.html

If i just want /Oilers/ with the file running name at the end, how would I go about?

View 4 Replies View Related

Get Ip Address And MAC Address Of System?

Apr 6, 2009

How to get Ip address and MAC address of system for an IP address i tried this code

echo $ip=GetHostByName($REMOTE_ADDR);

But after uploading through FTP i'm getting Server ip But i want local system IP can any one solve problem.

View 4 Replies View Related

Using $_SERVER['http_referer']

Jun 27, 2007

I'm using $_SERVER['http_referer'] to see which site the visitors on my site
is coming from. It works OK, but as we all now, not all sites give
http_referer a value, i.e. miniclip.com.
What I DON'T understand is how my web-statistics program (awstats) can tell
me that a lot of the visitors on my site comes from miniclip.com. How can
awstats know, and http_referer don't?

View 3 Replies View Related

$_SERVER['HTTP_USER_AGENT']

Jul 21, 2005

what is exact sense of $_SERVER['HTTP_USER_AGENT'] output?

View 1 Replies View Related

$_SERVER Not Working

Jun 15, 2006

I really loosing sleep over this one. I have php 4.4 running on Apache
2.... php works fine. phpinfo() retuns everything as it should..
However when I try to print anything using $_SERVER e.g $_SERVER
['HTTP_HOST']... it returns nothing. Then I realized that even $_GET
and $_POST are not working. All the uper globals are not working. They
just come back with e.g Array ['HTTP_HOST']...

View 7 Replies View Related

JSP Equivalent To PHP $_SERVER?

Jan 16, 2006

I looked up System.getProperties, but to be honest, I have no clue how
to use it in light of what I can do in PHP, which is this:

<?php echo $_SERVER['HTTP_USER_AGENT'] . ' ' . $_SERVER['SERVER_URI'];
?>

it would be very nice to find the JSP equivalent of <? phpinfo(); ?>
(anyone know who knows both PHP and JSP?) but until then, what on earth
do I do?

View 2 Replies View Related

$_SERVER['PATH_INFO'] Where Is It Under Php 4.3.8 ?????

Jul 17, 2005

I compiled a recent version of php 4.3.8 on Suse 9.0 Pro with apache
1.3.28 that was a precompiled for Suse as an rpm. When I look at
phpinfo(), I do not see the environment setting $_SERVER['PATH_INFO']
however, I can see this setting on a different box running windows
and on yet another box running linux. Is there something I have to
set in the configuration for the value to show up?

View 2 Replies View Related

$_SERVER['SCRIPT_FILENAME'] = '/php/php.exe'?

Jul 17, 2005

I am trying to use script filename to give me the entire path and
filename of the current page. For some reason though it is giving me
the value of '/php/php.exe'. Why might this be?

In my Apache http.conf file I do have the line:

Action application/x-httpd-php "/php/php.exe"

Might this have something to do with it?

View 1 Replies View Related

ADVERTISEMENT