Thanks Rich,

That worked fine on my PHP Version 4.3.1

The older syntax seems to work fine on an earlier version of PHP though
(Version 4.2.3)!!

Regards,
Sharat


-----Original Message-----
From: Rich Gray [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 4:11 PM
To: Sharat Hegde; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Retrieving Server and PHp variables


> Hello,
>
> I just upgraded from PHP3 to PHP4 on Apache 1.3.x on Windows NT. I need to
> access the PHP and SERVER variables on my PHP 4 installation. My
> code is as
> follows:
>
> <?php
>       echo $SERVER_SOFTWARE;
>       echo $PHP_SELF;
> ?>
>
> However, I get the following error:
>
> Notice: Undefined variable: SERVER_SOFTWARE in c:\program files\apache
> group\apache\htdocs\test\test1.php on line 2
>
> Notice: Undefined variable: PHP_SELF in c:\program files\apache
> group\apache\htdocs\test\test1.php on line 3
>
> Also, one more thing I noticed was that <?php phpinfo(); ?> shows
> the Server
> and PHP variables fine.
>
> Can you help out?
>
> Thanks,
> Sharat

Sharat

You will need to look up the superglobal array $_SERVER[] in the PHP
manual - a lot has changed since php3!

Try ...

<?
echo $_SERVER['SERVER_SOFTWARE'].' '.$_SERVER['PHP_SELF'];
?>

HTH
Rich
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to