Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a chat quest... 3

Status
Not open for further replies.

MAWarGod

Programmer
Feb 15, 2002
352
US
complete.gif


is it possible to do a chat interface like above in PHP? if so how would I get started? I have been trying to build this type of chat for years.. in perl or cgi but can not get the features I want.. So that I am very new to php I ask if this can be done?

MA WarGod

I believe if someone can think it, it can be programmed
 
complete.gif


is it possible to do a chat interface like above in PHP? if so how would I get started? I have been trying to build this type of chat for years.. in perl or cgi but can not get the features I want.. So that I am very new to php I ask if this can be done?


MA WarGod

I believe if someone can think it, it can be programmed
 
Thank You johnwm & jpadie

jpadie this is a good starting point...

allow Me time to set this up on My server and I am sure I will be back. But form the looks of it I think it could be made to the above screen shot...


thank You both again

MA WarGod

I believe if someone can think it, it can be programmed
 
jpadie ok question I need to setup a db in Mysql?

MA WarGod

I believe if someone can think it, it can be programmed
 
chatDB4.sqlite.db ???????

MA WarGod

I believe if someone can think it, it can be programmed
 
i used a sqlite database for this demonstration. you can use any database you want though.
 
ok I went to the other thread and did as they did and used mysql db..

Quote:

Uncaught exception 'PDOException' with message 'could not find driver' in C:\vhosts\fpgroups.com\chatroom\chatRoomServer.php:20


that's the problem. the code is not broken but you don't have the mysql driver for PDO installed. if you have root access you can do this with pear/pecl. you also need to enable the extension in php.ini.
end quote
pear/pecl is not in My cpanel is there a way around this?



MA WarGod

I believe if someone can think it, it can be programmed
 
I do have this in installs QA_Peardoc_Coverage
(1.1.1) PEAR documentation coverage analysis.

MA WarGod

I believe if someone can think it, it can be programmed
 
is there a way around this? sure, just change the pdo calls for native mysql calls. just a couple of minutes worth of work.
 
jpadie

is there a way to store this in a plain txt file?

MA WarGod

I believe if someone can think it, it can be programmed
 
sure. but it would be really inefficient. hence why i was using sqlite.
 
Hello jpadie and company ... !!!

I am that other guy jpadie helped with this very subject some months ago.

I took his startup scripts and made a few modifications and got a nice and very simple chat room going. Of course, jpadie helped well beyond the startup script - Thanks!

Check it here:



Let me know if you'll like me to wrap-up the code and put it up for download.

Notice that I added a "Logged in user" list ... One thing I never fixed was the problem with the time stamp, but I am sure it could be easily fixed.

Regards,
 
Hello southbeach


I am interested in seeing your chat but I keep getting Sorry, 'fpgroups.dynip.com' does not exist or is not available.


MA WarGod

I believe if someone can think it, it can be programmed
 
Ok please remember I am new to php so I am basicly asking
Code:
 private $pdo = null;
    private $timestamp = 0;
    private $action;
    private $db = 'chatDB4.sqlite';
    
    function chats(){
        $this->timestamp = time();
        if (!file_exists($this->db)){
            $this->pdo = new PDO ("sql
            ite:" . $this->db);
            $this->createDatabaseSchema();
        } else {
            $this->pdo = new PDO ('sqlite:'.$this->db);    
        }
        $this->action = isset($_POST['action']) ? $_POST['action'] : 'getChatData';
        $this->switchBoard();
    }
can be done these ways or close to them or maybe a better way sence I can not use the POD way...

first way I'd like to make a config.ini file
so later I could add mail server for registration?
Code:
/*
-----------
DB Settings
-----------
*/

define( 'DB_USER', '' );
define( 'DB_NAME', '' );
define( 'DB_HOST', 'localhost' );
define( 'DB_PASS', '' );
define( 'DB_TYPE', 'mysql' );
define( 'DB_PREFIX', 'mychat' );


// -------------
// Mail settings
// -------------

	// text|html
define( 'MAIL_FORMAT', 'html' );
		//mail|sendmail|smtp
define( 'MAIL_TYPE', 'mail' );
define( 'SMTP_HOST', 'localhost' );
define( 'SMTP_PORT', '25' );
define( 'SMTP_AUTH', '0' );
define( 'SMTP_USER', '' );
define( 'SMTP_PASS', '' );
define( 'SM_PATH', '/usr/sbin/sendmail' );
first is this possible if so please help Me from it I have been try to from it but cann't get it...is why I have taken so long to get back to thread...

or
config.php
Code:
<?php

// its hard to build without being able to test it

$dbms = 'mysql4';

$dbhost = 'localhost';
$dbname = '';
$dbuser = '';
$dbpasswd = '';

$table_prefix = 'mychat';



?>

MA WarGod

I believe if someone can think it, it can be programmed
 
Hi Southbeach,
I too am interested in what you came with
FYI your link leads to the "ethernet emptiness" :)
thanks
 
Hello guys!

The dudes at dynip got my domain name wrong. Try and simply click on the Chat Room option on the left panel.

Like I said, if you guys want this code, let me know, I will zip it up and make it available for you guys to download.

Regards,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top