Topic:   GMG Basic Chatbox Code Php+Html/Javascript   (Read 9233 times)


0 Members and 1 Guest are viewing this topic.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
GMG Basic Chatbox Code Php+Html/Javascript
« on: October 02, 2012, 12:07:33 PM »
Here's the basic code that's the base of the GMG chat box.
Use freely, no credit needed, learn from it, build on it, obliterate it, feed it to your pet wolf...

Ask any questions here.
« Last Edit: October 03, 2012, 05:03:17 AM by Gan »

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #1 on: October 02, 2012, 01:17:54 PM »
You're always so modest, Gan! ::) Did you at least sign your name in the first comments?
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

machorong


  • GMG Newbie

  • *

  • no avatar

  • Posts: 4

  • Gan is so awesome.
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #2 on: October 03, 2012, 04:25:09 AM »
I have these 3 error 2 on sendChat.php Undefined index: chat in C:\wamp\www\PHP Chat\chat\SendChat.php on line 11 and Undefined index: name the other one is also the same in RetrieveChat i'm sorry for asking these i'm a little noob in php and our defense will be in a week so can you help me guys??

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #3 on: October 03, 2012, 05:07:04 AM »
I have these 3 error 2 on sendChat.php Undefined index: chat in C:\wamp\www\PHP Chat\chat\SendChat.php on line 11 and Undefined index: name the other one is also the same in RetrieveChat i'm sorry for asking these i'm a little noob in php and our defense will be in a week so can you help me guys??
Ah, my bad. I forgot to mention, you need to setup an SQL database to conform to the PHP scripts.
You can re-download the scripts, I've added some markings at the top where you need to insert your database info so it'll work.
When you set up the SQL database, you need to make a new database with a table named 'chat'.
The chat table will contain a ID, Date, Username, Text and Action rows.

Do you need help setting up an SQL database?
(May I ask what you're using this for?)

machorong


  • GMG Newbie

  • *

  • no avatar

  • Posts: 4

  • Gan is so awesome.
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #4 on: October 03, 2012, 05:51:13 AM »
uhm thanks :)) but I know how to  use sql database.. well I'm using this for our project in webprog community building

machorong


  • GMG Newbie

  • *

  • no avatar

  • Posts: 4

  • Gan is so awesome.
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #5 on: October 03, 2012, 06:01:58 AM »
I'm still getting the error and I already create the  database. oh what is the data type of Action? boolean?

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #6 on: October 03, 2012, 07:13:32 AM »
ID - bigint
Username - longtext
Text - long text
Date - date time
Action - tinyint

Try setting those, if you still get an error, post a link here and I'll take a look.(or pm me the database and ftp info and I can debug the code myself)

machorong


  • GMG Newbie

  • *

  • no avatar

  • Posts: 4

  • Gan is so awesome.
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #7 on: October 03, 2012, 07:41:18 AM »
i'm not using any ftp server

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: GMG Basic Chatbox Code Php+Html/Javascript
« Reply #8 on: October 03, 2012, 10:32:38 AM »
Your sql is perfect. Just setup the chat box on local host from the source posted above and your sql. Worked flawlessly.