Send inquiry and send to email with php

0

How could I send the information that appears through my query, send it as a message to an email, any ideas? or someone who has something similar to guide me

<!DOCTYPE html>


<html>

 <form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
 	

<body>
		<table border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#A4A4A4" style="font-size:15px">
		
	
 </caption>
        
        <table id="">
		<tr >
			
			<tr>
				<th colspan="12" BGCOLOR="#B2BABB"><font size="2.9">REGISTROS</th>
			</tr>
			
			<th width="50" BGCOLOR="#B2BABB"><font size="2">ITEM </font></th>
			<th width="55" BGCOLOR="#B2BABB"><font size="2">FECHA </font></th>
			<th width="50" BGCOLOR="#B2BABB"><font size="2">OCURRENCIA</th>
			<th width="50" BGCOLOR="#B2BABB"><font size="2">USER</th>
				
		</tr>
		</table>
		
		

		<?php 
		

		$fechaIni="";
		$fechaFin="";
		$suma=0;
		    if(isset($_POST['submit'])){
        $busca="";

        $busca1="";

        $busca=$_POST['busca'];

        $busca1=$_POST['busca1'];

$mysqli =new mysqli('localhost','user','password','datos');
$mysqli->set_charset("utf8");

       

        if($busca!="" && $busca1!=""){
            
		 
            $res= $mysqli->query("SELECT * FROM datos Where Fecha BETWEEN '$busca' AND '$busca1'");

            
            while($f=$res->fetch_array())
            {
                       


		 ?>

		<table id="">
		<tr>

		<td align="center"> <font size="1"><?php echo $f['Item'] ?></td>
			<td align="center"> <font size="1"><?php echo $f['Fecha'] ?></td>	
			<td align="center"> <font size="1"><?php echo $f['ocurrencia'] ?></td>
			<td align="center"><font size="1"><?php echo $f['user'] ?></td>
			
			
		</tr>
		</table>
	           <?php
	           
            }

        

','America/Lima');
echo "<p align=right>".date("d/m/Y")."<br>".date("h:i:s");
        }
    }
    
    mail('[email protected]','mi titulo',$muestra);
?>



	
<div align="center">

                     
                </div>  


</body>
  
</html>
    
asked by user83962 14.11.2018 в 19:31
source

0 answers