PHP implementation by get way to identify the user to send mail, get send mail _php tutorial

Source: Internet
Author: User

PHP implements a Get method to identify how a user sends a message, and a get sends a message


The example in this paper describes how PHP implements a Get method to identify a user sending a message. Share to everyone for your reference. Specific as follows:

send_email.php as follows:

<?php  $conn =mysql_connect ("localhost", "root", "admin");  mysql_select_db ("Songyunb_development", $conn);  $id =$_get["id"];  $sql = "INSERT into email (sender_id,accepter_id,flag) VALUES ('". $_session["id"]. "', '". $id. "', ' no ')";  $query =mysql_query ($sql);  if ($query)  {    echo "";    echo "";  }? >

reg.php as follows:

<?php  $conn =mysql_connect ("localhost", "root", "admin");  mysql_select_db ("Songyunb_development", $conn);  $sql = "SELECT * from comments";  $query =mysql_query ($sql);  while ($out =mysql_fetch_array ($query))  {    echo $out ["content]." -------View Messages
"; }? >

newfile.php as follows:

<?php $conn =mysql_connect ("localhost", "root", "admin");  mysql_select_db ("Songyunb_development", $conn); $result = ""; $id = ""; if (Isset ($_get["id")) {  $id =$_get["id"];  $sql = "SELECT * from comments where id= '". $_get["id"]. "'";  $result =mysql_query ($sql); } $out =mysql_fetch_array ($result); Echo $out ["content"]. "
"; Echo $out [" Created_at "]."
"; echo" Send mail
"///See if there is a new mail $sql_search_email=" SELECT * from email where accepter_id= ' ". $id." ' "; $query =mysql_query ($sql _search_email), $result _email=mysql_fetch_array ($query), if ($result _email["accepter_id"]= =$_session["id"]&& $result _email["flag"]== "no") { echo " you have new mail ";}? >

login.php as follows:

<?php$conn=mysql_connect ("localhost", "root", "admin");  mysql_select_db ("Songyunb_development", $conn);  $_session["id"]=15;  echo "Clear session";  echo "Re-registration";? >

delete_session.php as follows:

<?php  if (isset ($_session["id"))  {   unset ($_session["id"]);  }  echo "";? >

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/1033497.html www.bkjia.com true http://www.bkjia.com/PHPjc/1033497.html techarticle PHP implementation by get method to identify the user to send messages, get send mail This article describes the PHP implementation of the way to identify the user to send mail. Share for everyone to join us ...

  • Related Article

    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.