Re: [PHP] PHP code will not work

2008-07-10 Thread Daniel Brown
On Thu, Jul 10, 2008 at 11:07 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: >>$_ENV > >>$_SERVER > > $_ENV and $_SERVER are. Though their contents are doubtless different. Proof that old dogs can learn new tricks. As n00b and fundamental as it may be, I took for granted that th

Re: [PHP] PHP code will not work

2008-07-10 Thread Richard Heyes
$_ENV >$_SERVER $_ENV and $_SERVER are. Though their contents are doubtless different. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP code will not work

2008-07-10 Thread Daniel Brown
On Thu, Jul 10, 2008 at 2:15 AM, Ted Wood <[EMAIL PROTECTED]> wrote: > > PHP at the command line doesn't run within a web server environment. Correct. EGPCS is inaccessible via the CLI (unless you force-populate the variables and arrays). Only via a web server will you have access to:

Re: [PHP] PHP code will not work

2008-07-09 Thread Ted Wood
PHP at the command line doesn't run within a web server environment. ~Ted On 9-Jul-08, at 11:07 PM, Sanjay Mantoor wrote: Hi, I found $_SERVER['HTTP_USER_AGENT'] works when you are using with browser by server like Apache. If you are executing your code like script in command prompt it may

Re: [PHP] PHP code will not work

2008-07-09 Thread Sanjay Mantoor
Hi, I found $_SERVER['HTTP_USER_AGENT'] works when you are using with browser by server like Apache. If you are executing your code like script in command prompt it may not work. I got below :- PHP Notice: Undefined index: HTTP_USER_AGENT If you use print_r($_SERVER) , you can see all the listi

Re: [PHP] PHP code will not work

2008-07-09 Thread Mike V
I had this problem and just figured it out. I was copying and pasting the code snippet from the tutorials page to my test editor and in the process picked up an invisible ctrl char. Doh!! Joseph Subida wrote: > > > The error I get when I try > > echo $_SERVER['HTTP_USER_AGENT']; > ?> > >

Re: [PHP] PHP code will not work

2008-06-13 Thread Daniel Brown
On Fri, Jun 13, 2008 at 1:51 PM, PJ <[EMAIL PROTECTED]> wrote: > > I had a similar problem and this was suggested and it worked for me: > > Try to put the global $_SERVER['HTTP_USER_AGENT'] into {}brackets: > > echo '{$_SERVER['HTTP_USER_AGENT']}'; > > I'm not sure about the single quotes in your s

Re: [PHP] PHP code will not work

2008-06-13 Thread PJ
Joseph Subida wrote: Daniel Brown wrote: On Wed, Jun 11, 2008 at 11:51 PM, Joseph Subida <[EMAIL PROTECTED]> wrote: Hi. I am new to PHP. I found a tutorial that said to copy and paste the code into a .php document and open it in my browser: I'm pretty sure PHP is enabled on my computer. I

Re: [PHP] PHP code will not work

2008-06-13 Thread Daniel Brown
On Fri, Jun 13, 2008 at 2:09 AM, Joseph Subida <[EMAIL PROTECTED]> wrote: > > 105: 106: echo $_SERVER['HTTP_USER_AGENT']; > 107: ?> > > All the code before line 105 is code that I've been messing around with. I > tried testing those three lines in its own file. But I still get the same > error: >

Re: [PHP] PHP code will not work

2008-06-12 Thread Joseph Subida
Daniel Brown wrote: On Wed, Jun 11, 2008 at 11:51 PM, Joseph Subida <[EMAIL PROTECTED]> wrote: Hi. I am new to PHP. I found a tutorial that said to copy and paste the code into a .php document and open it in my browser: I'm pretty sure PHP is enabled on my computer. I've tested code such as:

Re: [PHP] PHP code will not work

2008-06-12 Thread Daniel Brown
On Wed, Jun 11, 2008 at 11:51 PM, Joseph Subida <[EMAIL PROTECTED]> wrote: > Hi. > > I am new to PHP. I found a tutorial that said to copy and paste the code > into a .php document and open it in my browser: > > echo $_SERVER['HTTP_USER_AGENT']; > ?> > > I'm pretty sure PHP is enabled on my comput

Re: [PHP] PHP code will not work

2008-06-12 Thread Nathan Nobbe
On Wed, Jun 11, 2008 at 9:51 PM, Joseph Subida <[EMAIL PROTECTED]> wrote: > Hi. > > I am new to PHP. I found a tutorial that said to copy and paste the code > into a .php document and open it in my browser: > > echo $_SERVER['HTTP_USER_AGENT']; > ?> > > I'm pretty sure PHP is enabled on my comput