开发者

JQuery/PHP Chat Client Help

开发者 https://www.devze.com 2023-01-10 12:34 出处:网络
I found this cool Chat tutorial on CSS-Tricks. (http://css-tricks.com/chat2/) I am trying to use it however. Everytime I run it, and I enter my name when it asks in the chat room. It just shows this

I found this cool Chat tutorial on CSS-Tricks. (http://css-tricks.com/chat2/)

I am trying to use it however. Everytime I run it, and I enter my name when it asks in the chat room. It just shows this code:

Great! You found a username not in use"; $data['inuse'] = "notinuse"; } else { $data['result'] = "
That username is already in use. (Usernames take 2 minutes without use to expire)
"; $data['inuse'] = "inuse"; } echo json_encode($data); } } else { $username = cleanInput($_POST['userid']); if (checkVar($username)) { $getUsers = "SELECT * FROM chat_users WHERE username = '$username'"; if (!hasData($getUsers)) { $now = time(); $postUsers = "INSERT INTO `chat_users` ( `id` , `username` , `status` , `time_mod` ) VALUES ( NULL开发者_StackOverflow , '$username', '1', '$now' )"; mysql_query($postUsers); $_SESSION['userid'] = $username; header('Location: ./chatrooms.php'); } else { header('Location: ./?error=1'); } } } ?>

I wonder what the issue could be. Random, but this may help someone else :c)

And remember, I love you guys!


The fact that you are able to see the PHP code indicates this particular file is not being processed by PHP, just sending the file as plain HTML. It may be that your server is misconfigured and you cannot run PHP scripts, or the file has an extension not associated with PHP.

Other reason may be that the file permissions of the script are wrong, generally these permissions must be set to 0755.

0

精彩评论

暂无评论...
验证码 换一张
取 消