Chat programs using row-write (part 4)

Source: Internet
Author: User
(Followed by the previous sections) & lt; bodyleftmargin0topmargin0 & gt; & lt; divaligncenter & gt; & lt; br & gt; & lt; forw.hodpostactionlt3.php (as the mainstream development language) namefyq & nbsp; targetbforlt3onsubmitretu (connected to the previous section)






Script
Parent. wu ();
Write ();
Document. fyq. saystemp. focus ();
Script



Lt3.php (as the mainstream development language)
Process speech information

Session_start ();
Include ("g_fun.php (as the 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 to determine whether the user exists and prevent timeout from being deleted
$ 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 ){

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.