i am new to php & would like to call another php file on the same file in the div tag. on the home page i am calling the php file & have link on those files & want to open the result of that link below in the div tag. I want to dispaly the result of all the links in the div tag
Please Help !
Thanks in advance
ViewBdd.php
<html>
<body>
<table align="center" width="100%">
<tr>
<td>
<?php
$con=mysqli_connect("localhost","root","") or die("Failed to connect with database!!!!");
mysqli_select_db($con,"csdata");
$result = mysqli_query($con,"SELECT *
FROM `data`");
echo "<table border='1' cellpadding='5' cellspacing='2' style='border:black; ' align='center'>
<tr><th colspan='4'>(BDD-2015)</th></tr>
<tr>
<th id='td'>Customer Name</th>
<th id='td'>Rs. in Lakhs</th>
<th id='td'>Metric Ton</th>
<th id='td'>Percentage</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td align='center' id='td'><a href='sku.php?Customer_name=" . $row['Customer_name'] . "'>" . $row['Customer_name'] . "</a></td>";
echo "<td align='center' id='td'>" . round($row['Total'],2) . "</td>";
echo "<td align='center' id='td'>" . round($row['MT'],2) . "</td>";
echo "<td align='center' id='td'>" . round($row['Percentage'],2) . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?></td>
</tr>
</table>
</body>
</html>
sku.php
<html>
<body>
<table align="center" width="100%">
<tr>
<td>
<?php
$con=mysqli_connect("localhost","root","") or die("Failed to connect with database!!!!");
mysqli_select_db($con,"csdata");
$name=$_GET['Customer_name'];
$result = mysqli_query($con,"Select * from `data` ");
echo "<table border='1' cellpadding='5' cellspacing='2' style='border:black; ' align='center'>
<tr>
<th id='td'>Customer Name</th>
<th id='td'>Item Name</th>
<th id='td'>Rs. in Lakhs</th>
<th id='td'>Metric Ton</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td align='center' id='td'>" . $row['Customer_Name'] . "</td>";
echo "<td align='center' id='td'>" . $row['Item_Grouping'] . "</td>";
echo "<td align='center' id='td'>" . round($row['Amount'],2) . "</td>";
echo "<td align='center' id='td'>" . round($row['MT'],2) . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?></td>
</tr>
</table>
</body>
</html>