Jump to content
MakeWebGames

Recommended Posts

Posted

Re: Ajax chat script

it works for anything... Look at chat.php

At the top, you will notice the only php segment in that page is the headers for v1.1

I imagine they are close to lite - if not, just copy/paste your LITE headers over it

probably same for v2 as well

Posted

Re: Ajax chat script

Good stuff. Looking at your spam words, my users must play your games as well. LOL.

What about protecting against HTML code? I had a problem with my chat system and I had to do a search and replace for all html tags.

Posted

Re: Ajax chat script

hm, haven't tried that...

If this ajax operates the same way some of my other projects are, the only html it accepts is line breaks... but I should prolly check

Posted

Re: Ajax chat script

 

it works for anything... Look at chat.php

At the top, you will notice the only php segment in that page is the headers for v1.1

I imagine they are close to lite - if not, just copy/paste your LITE headers over it

probably same for v2 as well

Yeah, these are the Lite Headers.

Does this update automatically when a new post is entered, or does the user have to refresh, or is it on like a 5 second cycle?

  • 2 weeks later...
Posted

Re: Ajax chat script

<input id="chatnick" type="text" size="9" maxlength="10" >

change to

<input id="chatnick" type="hidden" size="9" maxlength="10" value={$ir['username']}>

 

That might do it.

  • 2 weeks later...
Posted

Re: Ajax chat script

I'm curious if this worked for anyone in 2.0

I had it working in 1.1, and was curious to try it in 2.0 but it gets bugged up(yes i changed the header portion)

*feels like a dork for screwing up his own code*

  • 4 months later...
Posted

Re: [mccode] Ajax chat script

 

one of the simplest ajax chat scripts you will find. No sql, just a text file ;)

First, create a php file (I called mine w.php)

Remember what you called it. If you are not confident of your coding skills, just keep the names I have for all the files.

w.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Notice at the top of that above file it has "chat.txt"? That is a reference to the chat text file (given below). You can use that name, or create your own. I will mention everywhere it needs to be changed if you decide to change it.

Now...

chat.txt

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Now for

chat.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Pretty simple stuff. Keep in mind while renaming files...

if you wish to change a file (say, w.php) then search chat.php for the string "w.php", and everywhere that occurs change it to the new filename you created.

I'm 80% sure you have to chmod the chat.txt file to 777, but I may be wrong.

You can set the number of lines it saves in the text file in the w.php file (its a variable near the top)

Lemme know how it works out for ya ;)

Posted

Re: [mccode] Ajax chat script

 

is there anyway i can get it so the user dont have to type in their name because someone can pretend to be someone else

hm... It should be where they don't have to type it in already (if I remember correctly)

  • 3 weeks later...
Posted

Re: [mccode] Ajax chat script

Warning: main(globals.php) [function.main]: failed to open stream: No such file or directory in /home/downsy00/public_html/chat.php on line 3

Warning: main(globals.php) [function.main]: failed to open stream: No such file or directory in /home/downsy00/public_html/chat.php on line 3

Fatal error: main() [function.require]: Failed opening required 'globals.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/downsy00/public_html/chat.php on line 3

if some one wud does this for free pm me plz

Posted

Re: [mccode] Ajax chat script

Warning: Division by zero in /home/mikey121/public_html/header.php on line 62

im a complete amature coder and would really apreciate some help plzzzz.. how can i stop this??? ???

~mikey121_101 ps.sorry for spelling mistakes

  • 1 month later...
Posted

Re: [mccode] Ajax chat script

Has anyone got this to work with 2.0? I see the chat room but when I go to put my text in there is no text in the message area but there is text being written to the text file...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...