Hey I just have a quick question about AJAX and PHP include();... I'll give an explanation of what I'm trying to accomplish.
So my game template is setup so I have 2 "layout" pages included everytime a page is loaded. I have a layout_top.php and a layout_bot.php. So in essence it looks something like:
include("layout_top.php");
PAGE CONTENT
include("layout_bot.php");
My layout_top.php script contains a nav bar, and a chat. The chat runs through AJAX and is running perfect so far, updating on its own and accepting new messages with ease.
My layout_bot.php script contains details about your character with a couple bar graphs for HP/Energy/etc and then under that is a few details about the game, time/date/etc.
What I am trying to do is get the HP/Energy bars to be automaticly updated through AJAX. But everytime I try to code it, it will not work. I know its not a syntax problem, because I have rewritten it and scanned over it 15 times now.
I guess what my question is, is if I have all my AJAX calls being made in layout_top.php will they be able to update a <DIV> in layout_bot.php? I figure the answer to that is no. So I try to put my AJAX calls to update the HP/Energy bars at the top of layout_bot.php and still it wont work and I'm thinking because the headers have already been called in layout_top.php? I am not sure. If anyone could let me know and maybe give me some insight on how to solve this problem that would be much appreciated.
Cheers