現(xiàn)在通過html提交表單,可以實(shí)現(xiàn)把數(shù)據(jù)插入到mysql中,php代碼如下? <?php?? ? session_start();?? ? $username=$_REQUEST["username"];?? ? $phone=$_REQUEST["phone"];?? ? $datetime=$_REQUEST["datetime"];?? ? $con=mysql_connect("localhost","root","root");?? ? if (!$con) {?? ? ? die('數(shù)據(jù)庫(kù)連接失敗'.$mysql_error());?? ? }?? ? mysql_select_db("user_info",$con);?? ? $dbusername=null;?? ? $dbphone=null;?? ? $result=mysql_query("select * from user_info where phone ='{$phone}' and isdelete =0;");?? ? while ($row=mysql_fetch_array($result)) {?? ? ? $dbusername=$row["username"];?? ? ? $dbphone=$row["phone"];?? ? }?? ? if(!is_null($dbphone)){?? ?>?? <script type="text/javascript">?? ? alert("手機(jī)號(hào)已存在");?? ? window.location.href="index.html";?? </script>??? <?php??? ? }?? ??? ? mysql_query("insert into user_info (username,phone,datetime) values('{$username}','{$phone}',now())") or die("存入數(shù)據(jù)庫(kù)失敗".mysql_error()) ;?? ? mysql_close($con);?? ?>?? <script type="text/javascript">?? ? alert("注冊(cè)成功");?? ? window.location.href="index.html";?? </script>?如何在這個(gè)基礎(chǔ)上同時(shí)把插入數(shù)據(jù)庫(kù)的內(nèi)容發(fā)送至指定郵箱呢?有沒有案例參考?
php表單提交至mysql怎么同時(shí)發(fā)送至指定郵箱
慕桂英546537
2019-03-13 14:22:47