I am trying to include a chat solution in my site.
The index file is in root_dir and the chat index file is in root_dir/chat
it workes if I include the chat index file as an iframe:
<iframe src="chat/index.php" width="100%" height="600px"></iframe>
but I am trying to pass the session’s user name to the chat so I have tried this:
$username = $_SESSION['username'];
chdir(CHAT_DIR);
include 'index.php';
I get an error. The chat solution is trying to include file from the parent directory and not the chat directory.
what can I do?
You could use cookies,
but you could also continue your session by linking the sites. You don’t need to change the folders.