Results 1 to 24 of 24

Thread: instant messenger on my website

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    100

    instant messenger on my website

    How can I put an instant web messenger on my website?

  2. #2
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: instant messenger on my website

    When you say instant messenger, do you mean to communicate with MSN, AIM, GTalk etc, or do you want like an instant chat feature, where you can type in messages to anyone currently viewing the site?

    Also, do you have an example of another website that has an IM function similar to what you desire?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    100

    Re: instant messenger on my website

    I was looking for something that doesnt use yahoo, msn, or any other service like that. The users would still need to log in. I was looking for something similar to php121 (www.php121.com). Thanks for the help!

  4. #4
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    I suppose you don't want to use PHP121 then?

    You can create your own using AJAX. Confirm this is what you want, and i can give you the basic steps for that.
    My usual boring signature: Something

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    100

    Re: instant messenger on my website

    I do not want to use php121. I am new to this and dont know AJAX or php or anything like that.

  6. #6
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    Well this is the basic process of the whole thing:

    1. User A Starts conversation #1234 With User B
    2. User A sents the message "Hello" which is stored in a database under convo #1234
    3. User B send the message "Hey, whats up" which is also stored in the db under convo #1234
    4. While all of this is happening, both windows are refreshing automatically (or using ajax) to query the database looking for convo #1234 messages.


    Does that make any sense? I feel like i was not clear enough.
    My usual boring signature: Something

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: instant messenger on my website

    Quote Originally Posted by red_bull_NRG
    I do not want to use php121. I am new to this and dont know AJAX or php or anything like that.
    Then you are posting in the wrong forum.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  8. #8
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: instant messenger on my website

    Quote Originally Posted by dclamp
    Does that make any sense? I feel like i was not clear enough.
    No.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  9. #9
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    Quote Originally Posted by visualAd
    No.
    yeah but see, you know how to do it... so be quiet.
    My usual boring signature: Something

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    100

    Re: instant messenger on my website

    Quote Originally Posted by dclamp
    Does that make any sense? I feel like i was not clear enough.
    Sorry, but it didnt make sense. As I said, I have absolutely no experience with stuff like this.

  11. #11
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    Ok no problem. Maybe i can make a illustration.
    My usual boring signature: Something

  12. #12
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    Quote Originally Posted by dclamp
    Ok no problem. Maybe i can make a illustration.
    here. this is the best i can do. If you still dont understand, i can just start writing sample code
    Attached Images Attached Images  
    My usual boring signature: Something

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    100

    Re: instant messenger on my website

    thanks for the illustration, now I understand how it works. But how can I program it?

  14. #14
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    I am glad you understand that. To make it easier for both of us, i am going to create the tutorial on my computer and upload it when i am done. Should be done tonight.

    I advise you take a look at the MySQL Help link in my signature. That explains MySQL queries, and well as using it with PHP.
    My usual boring signature: Something

  15. #15
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    ok, here is a VERY basic IM system in php. The code is somewhat sloppy because i wrote it in 2 hours. there are comments everywhere.

    Please ask questions regarding it, i am happy to answer.
    Attached Files Attached Files
    My usual boring signature: Something

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    100

    Re: instant messenger on my website

    Thanks so much for the help with the messenger. It's working great. I still have a couple questions though:

    How can I set up a MySQL database to handle the passwords and usernames?

    Also, how can I make a register page so people can set up a username and password?

  17. #17
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    oops, i forgot to add the databases in the file.

    Code:
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    
    --
    -- Database: `subsoft_chatdb`
    --
    
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `chatsessions`
    --
    
    CREATE TABLE IF NOT EXISTS `chatsessions` (
      `chatID` int(10) unsigned NOT NULL auto_increment,
      `sessionID` text NOT NULL,
      `fromuserID` varchar(45) default NULL,
      `startTime` varchar(45) NOT NULL,
      `endTime` varchar(45) NOT NULL,
      `touserID` varchar(45) NOT NULL,
      `status` tinyint(1) NOT NULL default '0',
      PRIMARY KEY  (`chatID`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
    
    --
    -- Dumping data for table `chatsessions`
    --
    
    
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `messages`
    --
    
    CREATE TABLE IF NOT EXISTS `messages` (
      `messageID` int(10) unsigned NOT NULL auto_increment,
      `sessionID` varchar(45) NOT NULL,
      `fromuserID` varchar(45) NOT NULL,
      `touserID` varchar(45) NOT NULL,
      `sendTime` varchar(45) NOT NULL,
      `message` text NOT NULL,
      PRIMARY KEY  (`messageID`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    
    --
    -- Dumping data for table `messages`
    --
    
    
    -- --------------------------------------------------------
    
    --
    -- Table structure for table `users`
    --
    
    CREATE TABLE IF NOT EXISTS `users` (
      `userID` int(10) unsigned NOT NULL auto_increment,
      `username` varchar(45) NOT NULL,
      `password` varchar(45) NOT NULL,
      PRIMARY KEY  (`userID`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
    
    --
    -- Dumping data for table `users`
    --
    
    INSERT INTO `users` (`userID`, `username`, `password`) VALUES
    (1, 'dclamp', '5f4dcc3b5aa765d61d8327deb882cf99'),
    (2, 'penagate', '5f4dcc3b5aa765d61d8327deb882cf99'),
    (3, 'robdog', '5f4dcc3b5aa765d61d8327deb882cf99');
    My usual boring signature: Something

  18. #18
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    Quote Originally Posted by red_bull_NRG
    Also, how can I make a register page so people can set up a username and password?
    Make a form with a username field and a password field and set the form action to that page, and at the top use mysql functions to add it to the database.

    I am not here do make your whole project for you, but i am more than happy to assist you when you have problems.

    For more information on mysql fuctions, have a look at the link in my signature. When you get something made up, post it here and we can have a look at it.

    My usual boring signature: Something

  19. #19
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: instant messenger on my website

    Quote Originally Posted by red_bull_NRG
    thanks for the illustration, now I understand how it works. But how can I program it?
    no offence mate, but maybe a good start would be to learn to program?
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  20. #20
    New Member
    Join Date
    Oct 2008
    Posts
    2

    Re: instant messenger on my website

    Quote Originally Posted by dclamp
    Make a form with a username field and a password field and set the form action to that page, and at the top use mysql functions to add it to the database.

    I am not here do make your whole project for you, but i am more than happy to assist you when you have problems.

    For more information on mysql fuctions, have a look at the link in my signature. When you get something made up, post it here and we can have a look at it.

    Dude, I am trying to implement an Instant Messenger on a Web Browser. Which database should the login page be access/query to store the username and password details?

    Thanks!


    Thanks!
    Last edited by dedach; Oct 14th, 2008 at 12:26 AM.

  21. #21
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    Your better off going with an already made program. The one i wrote was made in 5 minutes, and looks (and works) like crap.

    php121 is a great PHP IM application that is easily integrated into your site.

    We would be more then happy to assist you in integration.
    My usual boring signature: Something

  22. #22
    New Member
    Join Date
    Oct 2008
    Posts
    2

    Re: instant messenger on my website

    Quote Originally Posted by dclamp
    Your better off going with an already made program. The one i wrote was made in 5 minutes, and looks (and works) like crap.

    php121 is a great PHP IM application that is easily integrated into your site.

    We would be more then happy to assist you in integration.
    Thanks for your help!

    Actually, I wanted to learn how to do it myself rather than use something already present. If you could help me in that, I'd be glad.

    Or even ajax-im for that matter seems good, if I can manage to get it working myself.

    I am still trying to figure out which database does login query?
    Any tutorials that can help me better understand the code?

    thnx a lot!!

  23. #23
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: instant messenger on my website

    table users controls the login. And it uses md5 encryption to store the password.
    My usual boring signature: Something

  24. #24
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: instant messenger on my website

    It's never a bad idea to look at other examples, if only to see how the code works.

    http://www.hotscripts.com/PHP/Script...pts/index.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width