first i am blur about ur problem...
ok,
if the test.php will have code that include the connect.php, then it will be called by anyone who access the test.php that have a function that call to OpenDB() in connect.php
the test.php will need to call the OPenDB() function to get the connection and display dynamic data in test.php (whenever any user access that page).
if u are assume by calling (just one time the OpenDB() function) script don't have to call it for the next display, then u are not right.
if u don't want people from outside to access file1.php, if u are using Apache as your web server, you can protect the file1.php by using the .htacess configuration file.
i felt hard to understand your problem. i try to help based on what i guess. if i am wrong, do reply and explain and i will try to help some more.
you are more Yoda than i .... 🙂