Home Tutorialhelp Comment About the chat code having problems

 
 

Comment

ben
About the chat code having problems,
April 21, 2010 at 1:47 AM

Thanks Rose for the chat code
but i am having problem is not showing anything.
I also try the one u suggested thatt's Mysql deiven chat script below is the code:
function ShowLoginForm() {

?>

<b>Enter Your NickName</b>

<form name="chat" method="post" action="chat.php" target="_top">

<input type="text" name="nick" size="20">

<input type="hidden" name="action" value="enter">

<input type="hidden" name="chat" value="<font color=FF0000><b>Enters the Room</b></font>">

<input type="submit" name="Submit" value="Submit">

</form>

<?php

function Login() {

global $chat;

global $nick;



session_start();

session_register("nick", $nick);

?>

<frameset rows="563,62" cols="*">

<frame name="posts" src="chat.php?action=posts&nick=<?php echo $nick; ?>&chat=<?php echo $chat; ?>">

<frame name="form" src="chat.php?action=form&nick=<?php echo $nick; ?>">

</frameset>

<noframes>

<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>

</noframes>

</frameset>

<?php

}
function doSubmit()

{

if(document.chatform.chat.value == '') {

alert('Please enter some text!');

document.chatform.chat.focus();

return false;

}
function GetInput() {

global $HTTP_SESSION_VARS;

global $chat;

global $nick;

?>



<form onSubmit="return doSubmit" name="chatform" method="post" action="chat.php" target="posts">

<input type="text" name="chat">

<input type="hidden" name="nick" value="<?php echo $nick; ?>">

<input type="button" onClick="doSubmit()" name="Submit" value="Say">

<select name="col">

<option>Black</option>

<option>Red</option>

<option>Green</option>

<option>Blue</option>

<option>Orange</option>

</select>



<input type="button" name="DoFace1" value=" :) " onClick="sendFace(1)">

<input type="button" name="DoFace2" value=" :( " onClick="sendFace(2)">

<input type="button" name="DoFace3" value=" :D " onClick="sendFace(3)">

<input type="hidden" name="action" value="posts">

</form>

<script language="JavaScript">

function sendFace(faceNum)

{

switch(faceNum)

{

case 1:

document.chatform.chat.value = ':)';

break;

case 2:

document.chatform.chat.value = ':(';

break;

case 3:

document.chatform.chat.value = ':D';

break;

}



document.chatform.submit();

document.chatform.chat.value = '';

}

function doSubmit()

{

if(document.chatform.chat.value == '') {

alert('Please enter some text!');

document.chatform.chat.focus();

return false;

}

document.chatform.chat.value = '<font color="'+document.chatform.col[document.chatform.col.selectedIndex].text+'">'+document.chatform.chat.value+'</font>';

document.chatform.submit();

document.chatform.chat.value = '';

document.chatform.chat.focus();

return true;

}

</script>

<?php

}
global $HTTP_SESSION_VARS;

global $chat;

global $nick;
print '<meta http-equiv="refresh" content="10;URL=chat.php?action=posts&nick=<?php echo $nick; ?>">';
$svrConn = mysql_connect("localhost", "root", "") or die("<b>Error:</b> Couldnt connect to database");

$dbConn = mysql_select_db("chat", $svrConn) or die ("<b>Error:</b> Couldnt connect to database");
if(!empty($chat)) {

$strQuery = "insert into chatScript values(0, '$chat', '$nick')";

mysql_query($strQuery);

}
$strQuery = "select theText, theNick from chatScript order by pk_Id desc limit 20";

$chats = mysql_query($strQuery);
while($chatline = mysql_fetch_array($chats)) {

print "<b>" . $chatline["theNick"] . ":</b> " . swapFaces($chatline["theText"]) . "<br>";

}
function swapFaces($chatLine) {

$chatLine = str_replace(":)", "<img src='smile.gif'>", $chatLine);

$chatLine = str_replace(":(", "<img src='frown.gif'>", $chatLine);

$chatLine = str_replace(":D", "<img src='bigsmile.gif'>", $chatLine);

return $chatLine;

}
if (empty($action))

ShowLoginForm();

elseif ($action == "posts")

ShowAddPosts();

elseif ($action == "form")

GetInput();

elseif ($action == "enter")

Login();
I got below error:
Parse error: syntax error, unexpected $end in C:\wamp\www\Chat\chat.php on line 235

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
PHP

PHP Chat Systems A MySQL Driven
PHP Chat Systems A MySQL Driven Chat Script Tutorial This article will show you how to create a simple chat script using PHP and MySQL database... users who can chat with each other. You will come to know about the mechanism 

Ajax

Ajax Chat
; Php free chat php Free Chat is a free, simple to install, fast, customizable and multi languages chat that uses a simple file system for message and nickname... own chat commands . Metatron Chat Engine The Metatron Chat Engine is a PHP/MySQL 

OpenSourceSoftware

Open Source Chat
applets. In this way, WebChat is a true Web chat system. ... to 1000 users. BRIBBLE is easy to use and contains a php based management system....     Mazen's PHP Chat This is an Open Source chat program 

PHP Tutorial

PHP Chat Systems A MySQL Driven Chat Script Tutorial
page will be look like: Full code of the chat system is provided along... PHP Chat Systems A MySQL Driven Chat Script Tutorial   ... to know about the mechanism of each of the following php files step by step 

Java Beginners

java chat?
java chat?  which is the best tool for java web chat ? Is comet a good techonology ? what about its performance with tomacat 6 

Ajax Questions

chat application
chat application  I am trying to make a chat application , when user1 send private message to user2 ,a popup should show at user2's screen. i need this code 

Java Beginners

chat server
chat server  how to write code for Many-Many (Broad cast): Each client opens a socket connection to the chat server and writes to the socket. Whatever is written by one party can be seen by all other parties 

JSP Servlet Questions

video chat
video chat  Hi , how can implement video chat using jsp and servlet .but not use applet . I want to implement video chatting system in my... implement applet because this application is also run on MAC Operating System 

WebSevices Questions

Flash based Chat System - WebSevices
Flash based Chat System  Hi I would like to ask is it advisable putting the chat inside the Flash (integrated with the video), or putting it outside the the Flash using XMPP embedding in a website. What issues / pros 

Chat Server Tutorial

Chat Server
;  Download and get the code for Chat Server Version 1.0 chat.zip... Chat Server       Chat server is a standlone application that is made up the combination of two 

Java Beginners

java chat application
java chat application  Can u plz send me java code for Lan communicatino(chat 

Java Beginners

java chat application
java chat application  Can u plz send me java code for Lan communicatino(chat 

Programming Tutorials

X-Chat
X-Chat       X-Chat has two good features of usability: colored nicknames and alignment by text as opposed... by the beginning. Come to learn more about: http://silverex.info/download 

Java Beginners

Live Chat Application
Live Chat Application  Hello sir, I want to create "Live Chat Application" for my web site. When any person click on the Live Chat tab... the source code. Thanks in Advance 

Java Beginners

program for chat - Java Beginners
program for chat  please provide code for fallowing 1)Write a java program Multi-user chat server and client 

JavaMail Questions

chat server in java - JavaMail
give me code/idea how make a chat server which run on the network(WAN application...chat server in java  sir i was ask u question related to the chat server,and you has given a answer,but sir i want to make a network based chat 

RMI Questions

chat server in java - RMI
chat server in java  how develope a chat server in java language,not standalone application,i want to develpoe a web base application,please give me a idea,code, this application deployed in a netwok  Hi Friend 

Ajax Questions

Chat and make conference - Ajax
Chat and make conference  i am doing online messenger System in j2ee... in chat windows. if i select one friend which is online then how a new window will be open for chat. How i can referece the page for see the status of online off 

JSP Servlet Questions

Live Chat Application using java
Live Chat Application using java  I want to develop Live Chat Application for my web site, please help me by posting the code or by giving any suggestion, by which i can develop it.... Thanks in advance 

JSP Servlet Questions

Live Chat Application using java
Live Chat Application using java  I want to develop Live Chat Application for my web site, please help me by posting the code or by giving any suggestion, by which i can develop it.... Thanks in advance 

Swing AWT

video Chat problam - Swing AWT
and start live video chat. 6. How to write the code for above requirment i dont...video Chat problam  Sir How to implments the concepts of video chat in java. i am trying for video chat which work on internet, but i dont know how 

Java Interview Questions

chat message
chat message  how to create chat server which should be similar to google talk and facebook etc 

JMS Questions

Chat server
Chat server  Please provide me complete information for making a chat server project using JMS 

EJB Questions

chat server
chat server  i want to develop chat server through jsp+struts+spring+hibernate so please guide me 

HTML Questions

Chat window
Chat window  Hi .. In a chat application , on click of a button the chat window pops up.. It is a div in the chat homepage.. There are few other... in the same application. I want to know how to retain the chat window (along 

Java Beginners

multi user chat server - Java Beginners
multi user chat server  write a multi chat server and client with step by step explanation? please send me this source code to my mail id with step by step explanation 

Framework Questions

java chat using java media
java chat using java media   Remove the error of this code plz reply me fast on my mail ID **Deleted by Admin** package chating; //import java.applet.Applet; import java.awt.event.*; import java.awt.*; import 

Programming Tutorials

BEST CHaT
BEST CHaT       Tsuper ajax chat Read full Description 

Java Beginners

creating windo chat
creating windo chat   hi ... please could you help me in creating chat aprograme in java ???? with comments beside codes please 

Java Beginners

chat application - Java Beginners
chat application  i hv created a chat application , but i hav facing problem when i run it in lan , pc ping but apllication doent giv ressponce plz help for these if some one have work on java chat application my email id 

JavaMail Questions

chat server - JavaMail
chat server  i want to develop chat server in java using smtp and pop3 protocol.plz tell me what i have to do.what are the APIs i have to use 

Development process Questions

chat application - Development process
chat application  Hi, I need to start a chat application using servlet,jsp for my application it is for a government department. Is it possible to do that using servlet,jsp if yes how? thanx,regards zaks 

Java Beginners

Chat in Java wih GUI
Chat in Java wih GUI  Welcome all >> << how is everybody >< i wanna Chat program in java server & client thanks 

Mobile Applications Questions

multi client mobile chat application
mobile chat application  plz help me for creating wap based mobile chat application in neatbean. or simply multi client mobile chat application 

Design concepts & design patterns Questions

Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util....(" "); } } } When i am trying to compile the code i found the following error Error.... Please let me know more about the flaws. 58$14 name$Threadname$t$k$e$i$j$sc$x$y 

Design concepts & design patterns Questions

Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util....(" "); } } } When i am trying to compile the code i found the following error Error.... Please let me know more about the flaws. 58$14 name$Threadname$t$k$e$i$j$sc$x$y 

Design concepts & design patterns Questions

Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util....(" "); } } } When i am trying to compile the code i found the following error Error.... Please let me know more about the flaws. 58$14 name$Threadname$t$k$e$i$j$sc$x$y 

Java Beginners

j2me mobile chat application for multichat
j2me mobile chat application for multichat  plz help me for creating wap based mobile chat application in neatbean....or simply multi client mobile chat application thanx 

Java Beginners

j2me mobile chat application for multichat
j2me mobile chat application  plz help me for creating wap based mobile chat application in neatbean. or simply multi client mobile chat application. thanx 

Mobile Applications Questions

multi client mobile chat application
chat application for mobile  plz help me for creating wap based mobile chat application in neatbean. or simply multi client mobile chat application. its urgently thanx 

Mobile Applications Questions

multi client mobile chat application
multi client mobile chat application  plz help me for creating wap based mobile chat application in neatbean. or simply multi client mobile chat application. its urgently thanx 

JSP Servlet Questions

how to create chat application in jsp?
Creating Chat application in JSP  Creating Chat application in JSP i am developing online web portal using jsp, i need to communicate with admin, so i need integrate with the chat applicaion through the webportal 

JSP Servlet Questions

how to create chat application in jsp?
how to create chat application in jsp?  i am developing online web portal using jsp, i need to communicate with admin, so i need integrate with the chat applicaion through the webportal 

Programming Tutorials

Ajax Chat Application,Ajax Chat Application Program,Online Ajax Chat Application
Ajax chat Application Program Ajax chat application program request to server without refreshing the web page.  In this Session you will learn the how to display massage. This program call the method 'callchat()' for the massage 

Java Beginners

chat - Java Beginners
 

Programming Tutorials

Ajax chat Application
 

Programming Tutorials

Ajax chat Application
 

Struts Questions

How to make a chat application using Struts 2 ?
How to make a chat application using Struts 2 ?  Hello, I'm working on my final year project. i've to add chat application in that. how it can be done? 'm using eclipse for that.... plzzz reply 

JSP Servlet Questions

how to integrate chat application with jsp and servlet?
how to integrate chat application with jsp and servlet?  I was developing online web portal in jsp and servlet , in this web portal communicate with maintain admin so i desired to integrate with chat applicaton in this web portal 

Java Beginners

Problems connecting to a database. Java/SQLite
on an SQL database but i am having problems connecting to it, I think the problem...Problems connecting to a database. Java/SQLite  `print("try { con... class.forName and so are already done above this code sample 

Core Java

Ask Programming Questions and Discuss your Problems
Ask Programming Questions and Discuss your Problems       Dear Users, Analyzing your plenty of problems... all sorts of Java related problems round the clock. Believe it. Roseindia has 

Servers

Chat Server
 

PHP Tutorial

About PHP
3.1 The Basics 3.1.1 Basic Syntax 3.1.2 Code Syntax 3.2 PHP First Program 3.3... PHP is a widely used powerful scripting language basically used for creating... be deployed on most of the web servers and support almost all operating system platform 

Java Beginners

how to use a JInternalFrame in a JFrame to create a chat window in a client/server app?
how to use a JInternalFrame in a JFrame to create a chat window in a client/server app?  how to use a JInternalFrame within a JFrame? i want... with JDeskTopPane but i want a chat window which can be moved within the app(just like 

JSP Servlet Questions

bird feeder system code
bird feeder system code  i want to know about "bird feeder a business solution system in java" please help me for details. how can develop this system please tell me 

PHP Tutorial

PHP Tutorials from RoseIndia
the programmers to learn or use the readymade PHP code in their programming. PHP is one... PHP topics along with the example code. PHP Tutorials Starting PHP...: In this tutorial we will get to know about MySQL, and connectivity with PHP.   

General Information

About Vehicle Tracking System
About Vehicle Tracking System About VEHICLE TRACKING SYSTEM is the technology... different methods. A vehicle tracking system has certain components extremely... tracking system is an important utility for tracking vehicles at a given point in time 

Open Source

Open Source Instant Messaging & Chat written in Java
 

JavaMail Questions

JavaMail flagging problems - JavaMail
... ? here is my source code. import java.util.*; import java.io.*; import..." + mimeType); //here add the code for flagging /*if (message[i].isSet 

PHP Tutorial

php Include
consider an example of that we have two examples of chat and mail system and we want... php Include:       Include command provides the opportunity to include several php pages within a single page 

PHP Questions

developing a system using php n mysql
developing a system using php n mysql  hai guys...i need your help to developing a system to record reports.Where in this system main is login(user... or not yet...THE REASON WHY I SEND THIS HERE CAUSE I NOT YET STUDY ABOUT PHP WELL..I 

Java Beginners

the discount system.
the discount system.  hi.. im a beginner here in java. sadly i was asked to code this one. about inheritance. and i absolutely dont know how.. will someone will help me with this? please. i was asked to write a discount system 

Java Beginners

the discount system.
the discount system.  hi.. im a beginner here in java. sadly i was asked to code this one. about inheritance. and i absolutely dont know how.. will someone will help me with this? please. i was asked to write a discount system 

Java Beginners

Java Source code
Java Source Code for text chat application using jsp and servlets  Code for text chat application using jsp and servlets 

Software Services

PHP Development Companies
PHP Development Companies When we talk about PHP development companies, we...; With the rising popularity of PHP scripting language, the demand of PHP developers have increased several times, and the numbers of PHP developers and PHP development 

Blog

Sitemap PHP Tutorial
| Input - Output String Functions | Dynamic Dropdown Menu | PHP Chat Systems A MySQL Driven Chat Script | PHP XML and PHP Backend Sharing Data | XML DOM... PHP Beginners Guide | About PHP | PHP Introduction  | What 

OpenSourceSoftware

Open Source content Management System
Open Source content Management System The Open Source Content Management System OpenCms is a professional level Open Source Website Content Management System. OpenCms helps to create and manage complex websites easily without 

JSP Servlet Questions

please provide the code
please provide the code   Develop a multi-client chat application 

Development process Questions

Java: Some problems in given condition
Java: Some problems in given condition   SIR, I want to get the values from the table( database), if any one of the column of the table value is 0...||att.getdata2()==0) If I use this code in Java.I am facing NullPointerException 

PHP Questions

php form having 2 submit buttons
php form having 2 submit buttons  i have a php form and some text boxes.and 2 buttons"approve" and "disapprove". when i click on approve button the data from form should go in mysql database and mail should go to appropiate 

Software Services

GPS Patient Tracking System
System. Our proficient GPS software programmers are well versed about the latest... are quite aware about the latest GPS guiding system and remote sensing technology...GPS Patient Tracking System The patients with Alzheimer?s disease or dementia 

PHP Tutorial

About PHP GD
What is PHP GD Library GD: The GD graphics library is a developed by Thomas..., PHP, Tcl, Lua, REXX, Ruby etc.  The GD library is used to create dynamic image creation. GD is an open source code library and written in 'C 

Java Beginners

code
code  *strong textstrong text*hello,i'm having some problems getting the correct code for a program.The output of the program is listed below...: {Block 5} ADDRESS-3: {San Juan} POST CODE:{6745} ENTER CODE (XX TO stop) CODE 

Java Code Examples

pdf system
pdf system      ... were talking about are java.io.* for input output, com.lowagie.text.pdf.... will be given by the java command.  The code of the program is given below 

Ajax-Books

PHP Ajax Book
structures that combine JavaScript code and PHP code to report when something bad... a simple online chat that works exclusively using AJAX code, without Java applets, Flash code, or other specialized library, as most chat applications work 

Software Services

PHP Outsourcing
PHP Outsourcing Are you looking for an outstanding and user-friendly web application based on PHP language? Your search ends here. In Roseindia... team of php developers who have developed many offshore web projects 

Ajax

PHP Frameworks
is a simple online chat system which uses AJAX. Ajchat also allows sharing or embedding... JavaScript code.   AJASON PHP 5 library and JavaScript client... PHP Frameworks       

PHP Tutorial

PHP Cookies
PHP Cookies       Cookies are little packets of information that are stored locally on a computer system... html tag). Cookies can be used to store identifiable information about a user 

JSP Servlet Questions

source code - JSP-Servlet
source code for webcam chat application  I want source code for this webcam chat application. I like the concept of XAWARE ORG regarding web cam chat. So that i want the code through this XAWARE only.pls send the code as soon 

PHP Tutorial

Why PHP ?
Why PHP? Reasons to use PHP are given below: 1.    PHP is open source, free to download and use : PHP is free and you can download... access to the source code, it has following features also: Free 

Java Beginners

Java Source code - Java Beginners
Java Source code  Write a Multi-user chat server and client 

PHP Tutorial

Why PHP Is So Useful
like online shopping websites or chat sites. In fact, PHP has been used...PHP, or Pre Processor Hypertext, is a form of online website scripting that has... WordPress and Joomla to name a few. PHP is a program that can be downloaded for free 

Ajax Questions

Find currenly which field is having focus on html page? - Ajax
Find currenly which field is having focus on html page?  Hi All, Actually I want to ask question about Javascript, but there is no any option... having focus while Enter key press. On the basis of that I am submitting form 

PHP Tutorial

PHP Code Syntax
PHP Code Syntax PHP syntax is the set of rules which need to be followed to to write properly structured PHP code. Given below Some rules of PHP syntax... code, each PHP statement ends with semicolon. The semicolon is a separator 

Struts Questions

how to distinguish engines having same code - Struts
how to distinguish engines having same code  hi we are using struts as UI in application and from UI a file is uploaded and inserted into database... introduced a new engine for testing purpose it has almost same code as previous engine 

JSP Servlet Questions

Having problem with image upload....
Having problem with image upload....  I am uploading profile pictures in my site.But after uploading when I visit my home page where it is supposed... uploaded successfully and there is no doubt about that because I checked on the server 

Development process Questions

Web-based system development
Web-based system development  I have a system written in java... it to build a gui.For server side, which 1 is better for my situation, PHP or java script. And what tools that i need to have. I know about XAMPP, but its just support 

Spring 3

SPEL-System Property
Accessing System Property Using SpEL Spring 3 provides powerful Expression Language which can be used to work with system properties. Lets take an example to demonstrate how SpEL is used to access system properties. MyClass.java 

PHP Tutorial

PHP Variables Dump
about the variable. So, the programmer can easily understand the whole code...PHP Variables Dump There are some moments in our application when we face some problems or we work on someone else project the first thing we do is to check 

Ajax Examples

Ajax Code Libraries and Tools
. The key features of AJASON are: * Fully object oriented code in PHP 5.... The nice thing about having a front controller style on the server side... or understand DHTML, Ajax or DOM code.     PAJAJ: PHP 

Free PHP books

PHP Programming Books
, packages, or shell scripts?or migrating PHP 4 code?here are high-powered... of PHP. You're about to learn to use the most powerful web development language... development.  The PHP Cookbook is a collection of problems, solutions 

Java Beginners

How to detect system failure using java code - Java Beginners
How to detect system failure using java code  I am doing a project... to detect the process that make failure. I have no idea about the project so please help me. And i need some site to download java source code 

PHP Tutorial

PHP Error handling
PHP Error handling Your application must have an error handling codes. Without it, it looks very unprofessional. PHP have following error handling methods... reporting die() method You can use die() method as follows : <?php 

PHP Questions

calendar in php code - PHP
calendar in php code   Any Idea to create a calendar for school in PHP? I need a simple nd handy code 

PHP Questions

Pagination in PHP code - PHP
Pagination in PHP code  3.Pagination in PHP codeIs it possible to get the paging in PHP without database call? How will I show the image instead of numbering? any code that can help 

Java Beginners

car rent system project
car rent system project  pl, may I get a source code in java with user inter face about car rent system. if it is possible pl help me.   import java.util.*; class Car { private String make; private String model 

Hosting Tutorial

Space based web-hosting system
Space based web-hosting system Here, space based web hosting system refers.... The different types of space based web hosting system perform differently on the web. We have covered the basic information about a range of space based web hosting 

PHP Tutorial

What you'll need before start
knowledge of the following : HTML/XHTML JavaScript System Requirement for PHP Before code your first program, you must check requirement for PHP : For running Code, it is commended that you install MySQL, PHP and either IIS 

Programming Tutorials

Writing an Unique Article Having the Potential of Making Clients Run For You
Writing an Unique Article Having the Potential of Making Clients Run..., a virus is out there. No, No, we are not talking about computer viruses or bird... virus, which is coursing through the entire system of article writing, must 

Java Beginners

Having problem to set font and color
Having problem to set font and color  Hello Sir, i have some problem...")); //add an action listener to the button,below the code in which you.... by kurmadu89@yahoo.com   Hello Friend, Try the following code: import java.awt. 

Advertisements Advertisements
 

 

 

DMCA.com