Is there any way to call a PHP file inside an HTML document without using an input tag?
I am trying to display some results of my database (as a table) using the form tag (file2.php
) but I realize that the only way to display the results, is to have an input tag inside the form tag. Is there any way to simply display the results in my HTML website without using inputs?
Code:
<html>
<body>
<img src="file1.php">
<form action="file2.php" method="post">
<input type="submit" value="submit">
</form>
</body>
<html>
My file2.php is
---
<?php
define('DB_NAME', 'name');
define('DB_USER', 'yyyy');
define('DB_PASSWORD', 'xxxx');
define('DB_HOST', 'localhost');
$link=mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link){
die('Could not connect:' .mysql_error());
}
$db_selected = mysql_select_db(DB_NAME,$link);
if(!$db_selected){
die('Can\'t use' .DB_NAME .':' . mysql_error());
}
$cid=$_COOKIE["cid"];
$sql= "SELECT * FROM table WHERE PID='$cid' ORDER BY SUBTIME ASC;";
$result = mysql_query($sql);
echo "<table border=1>
<tr>
<th> SUBMISSION DATE/TIME </th>
<th> SYS </th>
<th> DIA </th>
<th> PULSE </th>
<th> WEIGHT </th>
</tr>";
while ($row = mysql_fetch_array($result)){
echo "<tr>";
echo "<td align='center'>" . $row['SUBTIME'] . "</td>";
echo "<td align='center'>" . $row['SYS'] . "</td>";
echo "<td align='center'>" . $row['DIA'] . "</td>";
echo "<td align='center'>" . $row['PULSE'] . "</td>";
echo "<td align='center'>" . $row['WEIGHT'] . "</td>";
echo "</tr>";
}
if(!mysql_query($sql)){
die('Error:' .mysql_error());
}
mysql_close();
?>