Você está na página 1de 2

Java Chat Installation Guide

1. Overview: The software includes: a) Java/JavaScript client applicaton. b) Server-side script that connects client applications. Java Chat homepage can be found here: http://www.php-development.ru/products/java-chat/ You can submit comments, suggestion and bug reports here: http://www.php-development.ru/contact.php 2. Installing server-side script: 3.1. Edit configuration variables in the init.php file (follow guidelines therein). 3.2. Upload the script to your server. 3.3. Open admin/setup.php in your browser to create MySQL tables. 3.4. Open server.php file in your browser. 3. Configuring client application: 4.1. Open chat.html file and find "Applet" section in the end of the file. 4.2. Find the following lines: var ServerURL = "http://ilyalyu.firstvds.ru/SERVER/server.php"; var host = "ilyalyu.firstvds.ru"; var port = 9102; Assign "ServerURL" variable to the URL of the server-side script, "host" variable to your domain name, and "port" variable to the port number you specified in the init.php file. 5. Integrating the software with your membership system. 5.1. Open init.php file and find "Custom Functions" section. This section contains "Check Password" and "Check if User Exists" subsections. 5.2. "Check Password" subsection contains 2 versions of check_password function that looks like this: function check_password($user, $pass) { <body of the function> } This function is called by the server-side script to validate login information against membership system. 5.2.1. The first version of check_password function (default) will validate any non-empty username. You can use this option to test the software.

5.2.2. The second version of check_password function will check username and password against MySQL database. To use this function, find out the name of MySQL table and the names of the fields in this table that contain login information. Assign the variables $table_name, $username_field and $password_field in the body of the function to the name of the table and the names of the fields. 5.3. "Check if User Exists" subsection contains 2 versions of check_userexists function that looks like this: function check_userexists($user) { <body of the function> } This function is called by the server-side script to check if the user with a given username exists. 5.3.1. The first version of check_userexists function (default) will validate any non-empty username. 5.3.2. The second version of check_userexists function will check username against MySQL database. 5.4. After editing the functions and uploading init.php to your server, restart the server-side script. You can do it by sending "shut down" message from the client application. If you did not configure the server-side script to restart automatically, you need to open server.php file in your browser. 6. Purchasing the software (Advanced version only): To use the software on your website, you need to purchase the site license: 6.1. One site license = $10. 6.2. One site license + installation assistance = $40. 7. Known problems: 7.1. Host does not allow executing daemons (see http://www.google.com/search? q=define:daemon for definition). Host has execution time limits. Try to find dedicated or semi-dedicated hosting plan. 7.2. Error message: "Fatal error: Call to undefined function ..." Most likely, your host does not have Sockets extension for PHP. Contact your hosting provider. 7.3. The server-side script starts without errors, but client application can not connect it. Most likely, socket connection is blocked by the firewall running on your server. Contact your hosting provider.

Você também pode gostar