Home >Backend Development >PHP Tutorial >Chat program using line writing (Part 4)_PHP tutorial

Chat program using line writing (Part 4)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:31:45828browse

(Continued from the previous part)









Name:

Say:







.checked=!(document.forms[0].towhoway.checked); document.forms[0].saystemp.focus();" title="whisper whisper">private chat





Action:



(favorite for small websites)
key="a" type="checkbox" name="as" checked onclick=parent.f1.scrollit();document.fyq.saystemp.focus();>
Scroll< ;/a>
<script> <br>parent.wu(); <br>write(); <br>document.fyq.saystemp.focus() ; <br></script>



lt3.php
(as the current mainstream development language)

Processing speech information

session_start(); include("g_fun.php
(as the current mainstream development language)
");
f_connectdb();

$query = "select max(lt_id) as rmaxid from lt_t_content"; $res = MySQL(The best combination with PHP)
_query( $query, $dbh);
$row = MySQL
(The best combination with PHP)
_fetch_array($res); $maxid = $row["rmaxid"]; if (empty($maxid)) { $maxid = 0; }
$maxid = $maxid + 1; //Add chat information$query = "insert into lt_t_content(lt_id,lt_speaker ,lt_speaked,lt_secrecy,lt_content,lt_time,lt_face)";
$query .= " values(".$maxid.",".$username.",".$towho.",1,".$oldsays .",now(),1)";
$res = MySQL
(The best combination with PHP)
_query($query, $dbh);

// Modify the last chat time, determine whether the user exists, and prevent it from being deleted after timeout
$query = "select count(*) as rcount from lt_t_online where lt_username = ".$username.""; $res = MySQL(The best combination with PHP)
_query($query, $dbh);
$row = MySQL
(The best combination with PHP)
_fetch_array($res); $lcount = $row["rcount"]; if ($lcount == 0) {

http://www.bkjia.com/PHPjc/509055.html

www.bkjia.com

truehttp: //www.bkjia.com/PHPjc/509055.htmlTechArticle (continued from the previous part) body leftmargin="0" topmargin="0" div align=center br form method= "post" action="lt3.php (as the current mainstream development language) " name="fyq"target="bforlt3" onsub...