Game Maker's Garage Forum

Game Creation => Code Exchange => Topic started by: Gan on October 02, 2012, 12:07:33 PM

Title: GMG Basic Chatbox Code Php+Html/Javascript
Post by: Gan 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.
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: Connors 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?
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: machorong 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??
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: Gan 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?)
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: machorong 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
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: machorong 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?
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: Gan 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)
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: machorong on October 03, 2012, 07:41:18 AM
i'm not using any ftp server
Title: Re: GMG Basic Chatbox Code Php+Html/Javascript
Post by: Gan 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.