I am trying to set up version 2.0.4 of phpfreechat on my site and having an issue with root-relative paths. I have the folder uploaded to /phpfreechat-2.0.4, so my server path is /phpfreechat-2.0.4/server
I am embedding the chat into a template, which can be used to create a page anywhere, so I need to use root-relative paths that start with /
I have added code as follows in the head:
- Code: Select all
<link rel="stylesheet" type="text/css" href="/phpfreechat-2.0.4/client/themes/carbon/jquery.phpfreechat.min.css">
<script type="text/javascript" src="/phpfreechat-2.0.4/client/jquery.phpfreechat.min.js"></script>
with the following in the body:
- Code: Select all
<div id="mychat"><a href="http://www.phpfreechat.net">phpFreeChat: simple Web chat</a></div>
<script>
jQuery('#mychat').phpfreechat();
jQuery('#mychat').phpfreechat({ serverUrl: '/phpfreechat-2.0.4/server',
check_server_config: true});
</script>
This results in the chat trying to load (black area, with 'Unknown error' in a white box), but a 404 for http://mysite.com/package.json and http://mysite.com/check.php This is because the paths should be http://mysite.com/phpfreechat-2.0.4/package.json and http://mysite.com/phpfreechat-2.0.4/check.php
I have also tried using
- Code: Select all
serverUrl: 'phpfreechat-2.0.4/server'
but it does not make a difference.
Can anyone explain what the problem is and how to fix it?
Thanks,
Craig