2
Answers

call php function in html button

snowal raj

snowal raj

7y
324
1
hai ,
 
how to call php function in from html button in same page .
 
 This is my code  but is not working
<html>
<head>
FromDate : <input type="date" data-date-inline-picker="true" name="dtpFromDate" />
ToDate : <input type="date" data-date-inline-picker="true" name="dtpToDate" />
<br> <br>
<button id="btnfun1" name="btnfun1" onClick="load();">Submit</button>
<table width="100%" border="5" >
<thead>
<td><strong><font color="#000000">client_name</font></strong></td>
<td><strong><font color="#000000">process description</font></strong></td>
<td><strong><font color="#000000">start time</font></strong></td>
<td><strong><font color="#000000">end time</font></strong></td>
<td><strong><font color="#000000">Duration </font></strong></td>
<td><strong><font color="#000000">userName </font></strong></td>
<td><strong><font color="#000000">utilization id</font></strong></td>
<td><strong><font color="#000000">call Status</font></strong></td>
<td><strong><font color="#000000">patient_name</font></strong></td>
</thead>
<?php
include_once ("psl-config.php");
// include_once ("user.class.php");
function Load()
{
$FromDate = $_POST['dtpFromDate'];
$ToDate =$_POST['dtpToDate'];
$mysqli = new mysqli(HOST, USER, PASSWORD,DATABASE);
// $result= GetData($mysqli,'ICCTRACE');
$sql = ("CALL SP_GET_LOG_SHEET");
$result = mysqli_query($mysqli, $sql);
// //
while(($row = mysqli_fetch_array($result)))
{
?>
<tr>
<td><?php echo $row['client_name']; ?></td>
<td><?php echo $row['process_description']; ?></td>
<td><?php echo $row['start_time']; ?></td>
<td><?php echo $row['end_time']; ?></td>
<td><?php echo $row['Duration']; ?></td>
<td><?php echo $row['userName']; ?></td>
<td><?php echo $row['utilization_id']; ?></td>
<td><?php echo $row['call_status']; ?></td>
<td><?php echo $row['patient_name']; ?></td>
</tr>
</head>
</html>
<?php
}
}
?>
 i want to call load function when i click submit button 
 

Answers (2)