Need help for mini chat program

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xecvantec
Forum Newbie
Posts: 2
Joined: Fri Sep 23, 2011 3:28 am

Need help for mini chat program

Post by xecvantec »

I want to have program like image 1.

I have code

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php

?>
<input type="hidden" name="des" id="des">

</input>
      <?php     
	  $str=" ";
	  	if (isset ($_POST["txtNi1"]))
      {
            $text1 =$_POST["txtNi1"];
			echo ("<br/>");
		  $str.=$text1."\\";
		  echo $str;
      }
		if (isset ($_POST["txtNi2"]))
      {
            $text2 =$_POST["txtNi2"];
			echo ("<br/>");
		  $str.=$text2."\\";
		  echo $str;
      }
	 
		  


?>

<body>

<form name="form1" method="post" action="test4.php">
<table>
	<tr>
    	<td>Nick 01: </td>
        <td><input name="txtNi1" type="text" id="txtNi1"/></td>
    </tr>
    <tr>
       <td colspan="2" align="center" > <input name="Send1" type="submit" value="Send" /></td>
    </tr>
</table>
</form>
<form name="form2" method="post" action="test4.php">
<table>
    <tr>
    	<td>Nick 02</td>
    	<td><input name="txtNi2" type="text" id="txtNi2"/></td>
    </tr>
    <tr>
    	<td colspan="2" align="center"> <input name="Send2" type="submit" value="Send" /></td>
    </tr>
</table>
</form>
    <div id="place" > </div>
    <td><input type="hidden" name="" value="" id="textHid"/></td>
    <input type="hidden" name="textHid" value="" id="textHid"/></span>
</body>
</html>
But it only show new content chat, and lost old content.

How i fix it?
Attachments
1.JPG
1.JPG (23.26 KiB) Viewed 324 times
Post Reply