Custom Programming -- Contact Us

PHP script to include files from protected server by username and IP

View files in this folder

Scenario : customer has a php script that needs to include files (.inc) from another server, but these .inc files need to be password protected and restricted to IP address so only php scripts running on a specific server can access these include files. Will require modification of our htacess software for an easy way to manage the security on the folders.

there's a .inc file in the folder "secure" and "secureip" both can be accessed with username : sam password : sam

the difference is "secureip" only allows access from a specific IP (our server).

Each php has its accompanying source code in the .txt file. try running each one to see ...

grab.php does not work because no username/pass is supplied

grabsecure.php passes the user/pass in the url so it works fine : http://www.technotrade.com/custom/phpinclude/grabsecure.php.txt

grabsecureip.php works on my server, but try putting this php script on your machine to see what will happen : http://www.technotrade.com/custom/phpinclude/grabsecureip.php.txt