0

I've created a php, MySql application about daily staff attendance report which is running on local linux server. I would like to keep my database online so that anyone can access the report remotely outside the office. but the data feeding must be in the local server.Can anybody give me an idea to implement this ? I'm not looking for database replication solution. I need to keep the Data feeding application Local and Database Online.

1
  • write your server details in db config file on local. isn't it working? Commented Dec 3, 2011 at 6:46

1 Answer 1

1

Add this at the beginning of your data feeding scripts:

if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
{
  die('Remote access for this section is forbidden...');
}

This code was extracted from the development controller file provided by the Symfony framework

You can play with the array in the if condition to allow access only from certain IP addresses.

Hope to be helpful! Good luck! =)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.