Reply to Re: How to include optonial info when running on local server?

Your name:

Reply:


Posted by stacey on 08/31/07 23:13

On Aug 31, 5:45 pm, Christian Aastorp <> wrote:
> I'm a newbie with php, but experienced with other languages. I'm
> maintaining a small site written in php. To ease debugging and updates
> I've used an onscreen reference to indicate identity of included files
> etc.
>
> I don't really want this reference to be visible to anyone but myself.
> So I searched the manual and found some promising predefined variables
> that I used in this code snippet:
>
> <?php
> if ($_SERVER['REMOTE_ADDR'] = "127.0.0.1") {
> echo $level1, '_', $level2, '_', $imageNO, ' ', $display;
> }
> ?>
>
> This worked spllendidly when I tested running our site locally using
> the XAMPP-bundle. But when I copied the code out to the real server it
> seems that all clients are found at 127.0.0.1!
>
> I'm sure there are lots of better ways both to fix my code, and
> especially totally different ways to do what I'm trying to achive, any
> suggestions very welcome!
>
> --
> Christian Aastorp

Don't know if this is what you're referring to, but you might want to
consider including some sort of a config file...ie. config.inc.php.

In this file, you can set a $DEBUG variable to 0 or 1 and then
reference that to determine whether or not to show your messages. You
just need to change the $DEBUG to false when you move it out of your
development environment. I use this same thing for setting mysql
servers, logins & passwords as well.

[Back to original 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

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