Jump to content
MakeWebGames

[mccode] Ajax chat script


seanybob

Recommended Posts

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 ;)

that should be the v2 one

Link to comment
Share on other sites

Re: [mccode] Ajax chat script

Kyle thanks for the reply... I have tried that code and I see the chat room fine but what happens is the chat room will post to the text file fine but wont show on the chat room window... So you can write what ever message in there you want but it wont show the messages in the room the only way I know its saving the messages and posting them is by looking at the text file... I messed with it for awhile even wrote mccodes email asking for help but they havent replied since they said the one on there main page works... Also if it helps I think its like 2.0.2 the version we are running...

Link to comment
Share on other sites

  • 3 months later...

Re: [mccode] Ajax chat script

Hi, Is there anyway instead of it just inputting the Message it could input this:

<div align='Center'><table width="100%" cellspacing="0" cellpadding="0" border="0" id="table1">

<tr><td width="2">

<p style="margin-top: 0; margin-bottom: 0">

header_left.png</td><td background="header_center.png">

<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana" size="1" color="White"><center>Name Says: Message</center></font></td>

<td width="2">

<p style="margin-top: 0; margin-bottom: 0">

header_right.png</td></tr></table></div>

 

I've tried fiddling with:

 

You're unable to view this code.

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

 

But it rejects it, Can any body help

Link to comment
Share on other sites

  • 4 years later...

Help with this chat script

Hello, ive looked everywhere in the code and i cant figure out why when i visit http://sargent-test.freeiz.com/chat.php it comes up with this:

 

PHP Error Message

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

 

PHP Error Message

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

 

Failed opening "global_func.php" well its on my server, i do not know what to do

Link to comment
Share on other sites

Hello, ive looked everywhere in the code and i cant figure out why when i visit http://sargent-test.freeiz.com/chat.php it comes up with this:

 

PHP Error Message

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

 

PHP Error Message

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

 

Failed opening "global_func.php" well its on my server, i do not know what to do

Well, you see, global_func.php is a NessyBug.

Some people might claim it's there, but no one has ever really seen it.

Ref: http://sargent-test.freeiz.com/global_func.php

Link to comment
Share on other sites

Well, you see, global_func.php is a NessyBug.

Some people might claim it's there, but no one has ever really seen it.

Ref: http://sargent-test.freeiz.com/global_func.php

 

ok i have no idea what you mean, but the global_func.php is in its own folder and ive moved it into the main directory and i get this error now:

 

PHP Error Message

Warning: require(header.php) [function.require]: failed to open stream: No such file or directory in /home/a7150680/public_html/chat.php on line 6

 

PHP Error Message

Fatal error: require() [function.require]: Failed opening required 'header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a7150680/public_html/chat.php on line 6

Line 6 is : require "header.php";

so i will add that to the main directory and then i have to addd header.php into the main directory to stop some more php bugs and then when i try to go to [url="http://sargent-test.freeiz.com/chat.php"[/url] it just takes me to the login page and i log in and then what where do i go from there?

Link to comment
Share on other sites

ok i have no idea what you mean, but the global_func.php is in its own folder and ive moved it into the main directory and i get this error now:

 

PHP Error Message

Warning: require(header.php) [function.require]: failed to open stream: No such file or directory in /home/a7150680/public_html/chat.php on line 6

 

PHP Error Message

Fatal error: require() [function.require]: Failed opening required 'header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a7150680/public_html/chat.php on line 6

Line 6 is : require "header.php";

so i will add that to the main directory and then i have to addd header.php into the main directory to stop some more php bugs and then when i try to go to [url="http://sargent-test.freeiz.com/chat.php"[/url] it just takes me to the login page and i log in and then what where do i go from there?

Go back to the drawing board. If you can not fix such simple issue's, we will be seeing a lot more simple issue's like this.

Link to comment
Share on other sites

Cant sum1 just help me with this prob then i will not ask ever again for any help

While we could do that, that defeats the purpose. Spoon feeding you, is not going to teach you. And if you can't see the simple error of "No such file or directory", then does it not mean "THERE IS NO SUCH FILE OR DIRECTORY AS THE ONE U REQUESTED"?

change your include() path to where you went and changed it.

Link to comment
Share on other sites

While we could do that, that defeats the purpose. Spoon feeding you, is not going to teach you. And if you can't see the simple error of "No such file or directory", then does it not mean "THERE IS NO SUCH FILE OR DIRECTORY AS THE ONE U REQUESTED"?

change your include() path to where you went and changed it.

 

ok i fixed the Path's now when i go to chat.php it takes me to the login page and then i log in and nothing....

Edited by ashstyx
Link to comment
Share on other sites

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...