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...