473,398 Members | 2,812 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,398 software developers and data experts.

is there any way to find what the domain name is for the site that my script might be running on?


I need for my script to be able to find out what the domain name is for
the site that it is running on. I looked through the $_SERVER vars, but
didn't see anything.

Aug 19 '05 #1
2 1121
lk******@geocities.com wrote:
I need for my script to be able to find out what the domain name is for
the site that it is running on. I looked through the $_SERVER vars, but
didn't see anything.


Under apache 1.3, try _SERVER["HTTP_HOST"]
Aug 19 '05 #2
lk******@geocities.com wrote:

: I need for my script to be able to find out what the domain name is for
: the site that it is running on. I looked through the $_SERVER vars, but
: didn't see anything.

I put the following in my doc area, called it "phpinfo.php", and browsed
it.

<?php
phpinfo();
?>

On my machine I see I have environment variables called

SERVER_ADDR 127.0.0.1
SERVER_NAME perk.localdomain

I forget how to access the environment from php, but I'm sure it's easy,
and it might change on different php versions anyway. You should have
something similar, though it will also depend on the web server software.

_HOWEVER_, a web server machine does not have to have a name, so you can
not depend 100% on finding a name at all. You might need to settle for an
ip address.

--

This space not for rent.
Aug 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jach | last post by:
How can I get the domain, username and PC network name (Win 2000 Pro & Win XP Pro PC's) of the current logged on user (logged onto a domain and access an intranet page, Window 2000 server running...
2
by: Fabrice Labrousse | last post by:
Hello, Here is a hard problem i cannot solve about window.opener method I think you'll need to be a specialist to find the solution... i can't find the solution by myself ! Please help me. Here...
7
by: Julia | last post by:
Hi, I have a web application running inside an organization and I need to post some data to an asp page sitting outside the organization How do I get failure or success error from the outside...
4
by: UJ | last post by:
I have a need to know what the domain name is when I'm running a site. Essentially the problem I have is that I let the user build a web page and then I display it using a IFRAME. But the IFRAME...
5
by: Dany C. | last post by:
We have install a valid SSL certificate issued to www.mycompany.com on our web server running IIS 6.0 / win2003 SP1. Then we have created a sub domain pointing to the same server for our web...
5
by: Rocky | last post by:
Hi, I have a webform, with 2 textboxs and a submit button. In the text box1, i enter a username and in textbox2 I enter the computer name. Both the username and computer name is in active...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
10
by: Sridhar | last post by:
HI, I am having problems setting up a website so that it will be available only inside the domain. We have three servers. One is iis server and second one is internal server and the third one is...
6
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.