I have made a page into which I fetch header, footer etc from different files. Each sub file needs to use some php. Currently what I am doing is that I am using
mysql_connect(servername,username,password);
in every subfile. Is there any shorter format for doing that so that I could connect only in the main file and the subfiles get connected automatically?