PHP Chat Script - Problem Ajax and variable in php
Posted: 14 Mar 2015, 17:58
I have set the
the chat is looking ok, the entrys come from harry.txt,
The chat with firebug show the right harry.txt and the code looks in browser
ok that is good .
but when i post entry, the chat post, is not in the text file ??
i take a look in the js the path come from data-subdir, all is ok ,i cant see errors, why is the post not in harry.txt
when i set (write) in $c_subdir = 'harry';
the code look like the same as bevore but chat is not going . i can see the chats bevore the harry.txt is loadet ok.
here little code from setchat, in website(i must set it with Iframe)
ok i think the mistake is here :
the setchat is ajax reload but the $first_get_value comes from the side and when side is reload the $first_get_value =0
that is very bad.
why must the setchat load with ajax ??
Code: Select all
$c_subdir = ''.$username.'';//$username comes from database
The chat with firebug show the right harry.txt and the code looks in browser
Code: Select all
<div data-subdir="harry/" id="chatwindow">
but when i post entry, the chat post, is not in the text file ??
i take a look in the js the path come from data-subdir, all is ok ,i cant see errors, why is the post not in harry.txt
when i set (write) in $c_subdir = 'harry';
the code look like the same as bevore but chat is not going . i can see the chats bevore the harry.txt is loadet ok.
here little code from setchat, in website(i must set it with Iframe)
Code: Select all
<iframe width="657" height="500" frameborder="0" style="background:#292929" allowtransparency="true" src="http://web-apps.hupsis-e107.de/e107_module/chat/chatfiles/setchat.php?userkey=2999d817f1ea5001303577bcafe11bd3&username=hups" name="shoutbox"></iframe>
Code: Select all
$get_user = $_GET['username'];
session_start();
$_SESSION['username'] = $get_user;
define('CHATADD', 0);
if(CHATADD !== 1) {
if(isset($_SESSION['username'])) define('CHATUSER', $_SESSION['username']);
}
$c_subdir = ''.$username.'';//$username comes from database
Code: Select all
$query = "SELECT * FROM e107_modul_book WHERE modul='chat' AND md5userid='".$first_get_value."'";
that is very bad.
why must the setchat load with ajax ??