| | |
How to get server address using php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2006
Posts: 197
Reputation:
Solved Threads: 5
hi friends
I have run the one php script live server(www.live.com/samplee.php) . this file access the staging server and run the staging server php file and display the result.
But I need the live server address server name also display in the staging serevr php page result page.
How can i get the live server address?
Please help me
I have run the one php script live server(www.live.com/samplee.php) . this file access the staging server and run the staging server php file and display the result.
But I need the live server address server name also display in the staging serevr php page result page.
How can i get the live server address?
Please help me
Thanks
VSSP
VSSP
That code should not give you an ip address, unless the server isnt setup with a host name. I dont understand your problem if you are calling a page on another server you already know the other server's host name...
try this:
The function 'getenv' does not work if your Server API is ASAPI (IIS).
So, try to don't use getenv('REMOTE_ADDR'), but $_SERVER["REMOTE_ADDR"].
php Syntax (Toggle Plain Text)
<? $address = getenv("REMOTE_ADDR"); echo $address; // Or simply use a Superglobal ($_SERVER or $_ENV) $ip = $_SERVER['REMOTE_ADDR']; ?>
So, try to don't use getenv('REMOTE_ADDR'), but $_SERVER["REMOTE_ADDR"].
Last edited by Shanti Chepuru; Sep 25th, 2008 at 3:19 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
![]() |
Similar Threads
- Apache (Linux Servers and Apache)
- IP-to-Country converter (php script) (PHP)
- random page crashes in php (PHP)
- Using PHP to Send Email to a single DB list member every 24 hrs. (PHP)
- how to detect the username sharing by IP address? (PHP)
- Help on moving tables from one server to another (PHP)
Other Threads in the PHP Forum
- Previous Thread: Your comment please.
- Next Thread: PHP Webservices
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array basics beginner binary broken cakephp checkbox class cms code cron curl database date datepart directory display download dynamic echo email error file files folder form forms function functions google head href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite multiple mysql number oop parse password paypal pdf php phpmyadmin problem query radio random recourse recursion regex remote script search seo server sessions sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web webdesign xml youtube






