PHP uses the get method to identify users' email sending methods.

Source: Internet
Author: User
PHP uses get to identify the way users send emails and get to send emails. PHP uses the get method to identify mails sent by users. the example in this article describes how PHP uses the get method to identify mails sent by users. Let's share it with you for reference. PHP implements the get method to identify the way users send emails, and get sends emails.

The example in this article describes how PHP uses get to identify users' email sending methods. Share it with you for your reference. The details are as follows:

Send_email.php is 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 "《script》alert('?????????');《script》";    echo "《script》window.location.href='reg.php'《script》";  }?>

Reg. php is 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 emails
";}?>

Newfile. php is 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 email
"; // Check whether there is any new email $ 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 a new email";}?>

Login. php is as follows:

<? Php $ conn = mysql_connect ("localhost", "root", "admin"); mysql_select_db ("songyunb_development", $ conn); $ _ SESSION ["id"] = 15; echo "clear session"; echo "re-register";?>

Delete_session.php is as follows:

<? Php if (isset ($ _ SESSION ["id"]) {unset ($ _ SESSION ["id"]);} echo "script" alert ('cleared successfully'); script ";?>

I hope this article will help you with php programming.

Examples in this article describes how PHP can identify users' emails by using get. I will share it with you for your reference...

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.