Technology TidBits

Answers to various technical questions on php programming, mysql, linux, and many more categories.



Add comment:
Name:
Email:
Comment: *
(Use BBcode - No HTML)


You MUST answer this simple math equation - to prevent spammers: 1 + 4 =  


How can I test a portion of my php code without everyone seeing it?

Last updated: 09/06/2010

One quick way to test your code (php) without setting up a copy of the page / functionality, is to simply limit the modifications by IP address.  You can find out your IP address from various sites on the 'Net, then plug it into your script like so:

One quick way to test your code (php) without setting up a copy of the page / functionality, is to simply limit the modifications by IP address.  You can find out your IP address from various sites on the 'Net, then plug it into your script like so:

$testing = false;

if($_SERVER['REMOTE_ADDR'] == "your.ip.address.here") {

  $testing = true;
}

Now you can check for the "$testing" variable anywhere you have new code being executed.

 





Powered by KnowledgebasePublisher 1.1
Superb Internet
Content provided by Roberts WebForge, Inc.