Loading ...
Sorry, an error occurred while loading the content.
 

Re: [phpXperts] Need description about $_ENV environmental variable?

Expand Messages
  • maSnun
    Assuming that you are on Windows, please consult this link: http://support.microsoft.com/kb/310519 Regards. ... -- Abu Ashraf Masnun Grad Student, BBA, Khulna
    Message 1 of 6 , Jun 28, 2009
      Assuming that you are on Windows, please consult this link:
      http://support.microsoft.com/kb/310519

      Regards.

      On 6/27/09, Tariq mahmood <tariqb2b@...> wrote:


      Thanks,

      I tried on my hosting server its working. I tried with print_r($_ENV) to view all variables.

      But unexpected its not showing on my machine. I need to know how can i set these values in my machines and what file need to set?



      Regards,
      TARIQ MAHMOOD

      --- On Fri, 6/26/09, maSnun <masnun@...> wrote:

      From: maSnun <masnun@...>
      Subject: Re: [phpXperts] Need description about $_ENV environmental variable?
      To: phpexperts@yahoogroups.com
      Date: Friday, June 26, 2009, 7:06 AM

      I tried on Windows Vista. $_ENV["COMPUTERNAME"] is ok here. No $_ENV["HOSTNAME"] though.

      Try $_ENV["USERNAME"] instead of $_ENV["USER"].

      The variable depends on your server environment as far as I know.

      Try these codes to get the full list of $_ENV keys and their values:


      <?php foreach($_ENV as $k => $v) { echo "<b>".$k."</b>: ".$v." <br>"; }  ?>

      Put the line of code in a php file on your server and visit it online. Hope it helps.





      On 6/26/09, Tariq mahmood <tariqb2b@yahoo. com> wrote:


      Hi,

      Can anyone give me detail description about $_ENV environmental variable. I got little description from the link

      http://php.rhnet. is/manual/ en/reserved. variables. environment. php

      but when i try in my windows wamp environment these examples are not working.

          echo "My User name is ". $_ENV["USER"];   
          echo "Hostname name is ". $_ENV["HOSTNAME"];
          echo "Computer name is ". $_ENV["COMPUTERNAME"];

      why its not given any output in my windows wamp environment? where we can use this?

      Regards,
      TARIQ MAHMOOD





      --
      Abu Ashraf Masnun
      Grad Student, BBA,
      Khulna University.
      http://masnun. com




      --
      Abu Ashraf Masnun
      Grad Student, BBA,
      Khulna University.
      http://masnun.com
    Your message has been successfully submitted and would be delivered to recipients shortly.