View Full Version : file refresh once when accesed

03-27-2007, 08:49 PM

I have made a header file and includes it within a template file using AJAX since I couldn't use php's include(); function nor javascript.

What I am wanting to do is get that page that I am calling using AJAX to refresh once everytime you access a page that has that AJAX file calling.
The reason I want this is because if you log in it doesn't update the menu I have for loggedin users to show, instead it still shows that you r not logged. I have to manually refresh the page by accesing it but I don't want that. I want the file to refresh once when accesed through any other file that includes it.

Hope it makes sense.
Here is the ajax code I am using.

<script type="text/javascript">
var rootdomain="http://"+window.location.hostname

function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
catch (e){
page_request = new ActiveXObject("Microsoft.XMLHTTP")
catch (e){}
return false
page_request.open('GET', url, false) //get page synchronously

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)

and then the code that calls the page

<script type="text/javascript">

The header.php file above is called from index.php and I want the header.php page to refresh without the user noticing but only once when you access the page.

Thanks for any help.

03-27-2007, 10:40 PM
anyone??? I jus need something to update the file before it displays,

03-28-2007, 01:31 PM
which is the error you get?