You are here: Re: Problem running PHP on localhost « PHP Programming Language « IT news, forums, messages
Re: Problem running PHP on localhost

Posted by Kim Andrι Akerψ on 06/12/07 21:23

Phil Preen wrote:

>
> "Phil Preen" <n/a> wrote in message
> news:466f075c$0$8753$ed2619ec@ptn-nntp-reader02.plus.net...
> > I have installed Apache and PHP (and MySQL) on my own computer so
> > that I can test out my scripts without having to keep uploading
> > them to my ISP. I have created a very simple php script (below)
> > just to test out my set-up. This works fine when I upload it to
> > the server at my ISP (when I type something in the box, it is
> > displayed back to me) but when I run it on my own system, I get
> > nothing. I can see the value in the querystring in the address bar
> > of my browser, but the $eek variable does not seem to be being set.
> > Is there something I need to enable in PHP or Apache to make this
> > work?
>
> Found it. I needed to set register_globals=on in php.ini

The requirement of register_globals being on is just a result of bad
programming practices, really. You should make an effort to use the
$_POST and $_GET arrays instead, based on the request method ("post" or
"get"). In a pinch, use the $_REQUEST array, but please note that this
also contains the elements from $_COOKIE as well (HTTP cookies).

As for server variables, use $_SERVER instead.

PHP manual: Using Register Globals:
http://www.php.net/manual/en/security.globals.php

--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация