melange chat server for linux --> examples
Author: Christian Walter
Description: melange chat server for linux, online documentation --> examples
Keywords: examples, php, html, howto, about, melange, chat, server, linux, java, client, free, download, vienna, christian, walter

MELANGE USER GUIDE 1.10 - INDEX |

IMPLEMENTING THE CLIENT INTO YOUR WEBSITE 1. Default installation If you want to want to test the melange client on your webserver, you can use the example.html file coming with the package. It looks like: example.html

    <html>
    <body bgcolor="WHITE">
    <applet code="chatclient.class" height=400 width=600>

    [required]

    <param name="host" value="www.yourserver.at">	(ServerName)
    <param name="port" value="6666">		(ServerPort)
    <param name="UserName" value="Guest">		(Username)
    <param name="Fullscreen" value="Yes">		(Yes/No)
    <param name="Unique" value="Yes">		(Yes/No)

    [optional]

    <param name="Channel" value="0">		(ChannelName/ChannelID)
    <param name="Group" value="10"> 		(GroupId)
    <param name="Password" value="test">		(GroupPassword)

    </applet>
    </body>
    </html>
Before you can open this file with your browser you at least have to change the parameter HOST of this file to the hostname, melange is running on. Due to Java-Applet restrictions, this must be the same machine, the HTML-File is on (usually your webserver). That means: The host melange is running on (usually) has to be your webserver. See the FAQ for details. You can/have to change other parameters in the example.html file like the PORT, Melange is listening on, the default USERNAME, if you want to enable the FULLSCREEN feature and if you configured the server to use UNIQUE nicknames or not. These parameters HAVE TO be in the html-file. Optional you can set the default CHANNEL and the GROUP the user should be in. (If you want to set the group you have to set both, the GROUP and the PASSWORD parameter). Also all .class files coming in the client directory of the Melange package have to be in the same webserver-directory the example.html file is in. 2. Change default example.html The example.html file is a standard HTML-Page. As long as the minimun parameters are set as described above, you can edit this page like any other page and add all kinds of HTML-Commands like pictures, links, text, etc. 3. Webserver running PHP3 If you don't want to use default usernames for every user, and you are running PHP3, it's very easy to implement the feature. You then have one page, where the user enters his name into a form with a textfield, and a second page, where the applet is initialised with the name the user typed in. Here are the codes of both pages: entername.html

    <html>
    <body bgcolor="WHITE">
    Example page 1
    <form method=post action="startchat.php3">
    Please enter your name:
    <input type="text" name="nickname" size=30>
    <input type="submit" NAME="submit" value="START">
    </form>
    </body>
    </html>
startchat.php3

    <html>
    <body bgcolor="WHITE">
    Example page 2
    <applet code="chatclient.class" height=400 width=600>
    <param name="host" value="www.yourhost.com">
    <param name="port" value="6666">
    <param name="YourName" value="<? print($nickname) ?>">
        ...
        ...
    </applet>
    </body>
    </html>
You can test this construction at: http://www.terminal.at/chat. 4. Webserver running PERL A script for creating a login system using PERL and the files for the PHP login-system could be found in the goodies directory of the packages !

Copyright © 1998,1999 by Christian Walter. All rights reserved. Design, Images, Contents, etc. Copyright © 1998,1999 by Christian Walter. All rights reserved.