when i use the $_SERVER['SERVER_name']
i am reciving the ip of the server i run on and not its name for example!!!
why is that?
thnaks i advance
peleg
getting server name
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
basically, http://localhost/blah.php -> localhost ; http://192.168.0.0/blah.php -> 192.168.0.0 ..Predefined Variables wrote:'SERVER_NAME'
The name of the server host under which the current script is executing. If the script is running on a virtual host, this will be the value defined for that virtual host.
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
ok in my case i use the computers names
i use the computers names as my server names!
how can i get the computer name?
thnaks in advance
peleg
how can i get the computer name?
thnaks in advance
peleg
you could prob get the computer name by using exec() somehow,
but i dont know what the command is
print_r($_SERVER);
see if theres anything you could use in there.
if you need to use names:
a- create a unique config file for each script, putting the corresponding server name into it
b- set up apache to use virtual hosts so you can name them
if u want to use virtual hosts and cant figure out how,
tell us what version of apache and what o/s your using and we can help.
but i dont know what the command is
print_r($_SERVER);
see if theres anything you could use in there.
if you need to use names:
a- create a unique config file for each script, putting the corresponding server name into it
b- set up apache to use virtual hosts so you can name them
if u want to use virtual hosts and cant figure out how,
tell us what version of apache and what o/s your using and we can help.
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
ok i have :
apache 2.0.46 and php 4.3.2
i have apache 1 on : windows 2000 and 1 on windows 2003 server
so how do i configure virtual hosts for them>??can i config more then 1 domain on a pc?and how other users in my network - how here pc's will find each of the "domain" we configure?
and more then that
how can i redirect a certain "domain" from one serve to another?
thnaks i nadvance
peleg
i have apache 1 on : windows 2000 and 1 on windows 2003 server
so how do i configure virtual hosts for them>??can i config more then 1 domain on a pc?and how other users in my network - how here pc's will find each of the "domain" we configure?
and more then that
how can i redirect a certain "domain" from one serve to another?
thnaks i nadvance
peleg