eirikra 0 Newbie Poster

This might be a stupid question, as I am a complete beginner in the world of AJAX/Javascript. However, I am trying to build a website using Ajax combined with PHP/MySQL. The issue I have at hand is that the PHP variables and functions that I have included in the header.php is no longer valid when use Ajax to open a new page (without reloading). Probably a confusing explanation, but as I said; I have no experience in this part of web development, and I'm looking to learn more.

I have a header file which includes various other PHP-files with some classes and functions. This is also where I am connecting to the MySQL database. Following this I have a main menu, where the links are calling a Javascript, in order to show a new page without the reloading. These new pages are dependant on a MySQL-connection, but it seems that they cannot use the existing connection established in the header. I have also tried to simply define the variable"$foot = "Hello"; in the header, but this one also seem to "disappear" when the other pages are loading.

How can I solve this? Any advice is much appreciated!