You are here: Re: $_SERVER not working « PHP Programming Language « IT news, forums, messages
Re: $_SERVER not working

Posted by Gary L. Burnore on 11/07/47 11:50

On 15 Jun 2006 20:23:33 -0700, "Puneet" <puneet.puneet@gmail.com>
wrote:

>Thanx Bent... That helped..
>I rewrote the code as :-
>print "Host port is :". $_SERVER ['SERVER_PORT'] ;
>
>and it worked...
>
>There has to be a space between SERVER and [.. otherwise PHP throws an
>exception.
>

Now if you could JUST STOP TOP POSTING.

>


>
>Bent Stigsen wrote:
>> Puneet wrote:
>>
>> > Nope.. If i use your code.. then I am getting this..
>> >
>> > PHP Notice: Undefined index: HTTP_HOST in C:\Program Files\Apache
>> > Group\Apache2\htdocs\_debug_tmp.php on line 5
>>
>> Then it is (probably) not present in the http-request. Blame your
>> browser/proxy.
>>
>> Perhaps you can use 'SERVER_NAME' instead.
>>
>>
>> > If i use
>> > Print "Host is : $_SERVER ['HTTP_HOST']";
>>
>> Wouldn't work. When using an array inside an string, you will need the curly
>> brackets to tell PHP to use the index.
>>
>> > The I am getting..
>> > Host is : Array ['HTTP_HOST']
>>
>> Since the index is not used, it just tells you that $_SERVER is an array.
>>
>>
>> [snip]
>>
>>
>> --
>> /Bent
>>
>> PS: please don't top post
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация