我对 PHP 比较陌生。对于我的网页,我需要在同一页面中加载多个页面。因为我有一个名为 cwt.html 的基本 HTML 页面,其中包含所有复选框和提交按钮。单击提交按钮后,与所选复选框(cwt.html)关联的下一页(例如 processing.php)也应加载到同一页面中。
<html>
<head>
<title> Conditions We Treat </title>
</head>
<body>
<form id = form1 action = "processing1.php" method = "post">
<input type = "checkbox" name = "sickness[]" value = "Nausea">Nausea</input><br/>
<input type = "checkbox" name = "sickness[]" value = "Constipation">Constipation</input><br/>
<input type = "checkbox" name = "sickness[]" value = "vomiting">Vomiting</input><br/>
<div id = "submit1"><input type = "submit" name = "submit" value = "submit"></input></div><br/>
</form>
</body>
</html>
在此网页中单击提交按钮后,控件应转到 processing1.php,但必须在同一页面中加载内容
<html>
<head>
<title> Conditions We Treat </title>
</head>
<body>
<?php
echo "hi"
foreach($_POST['sickness'] as $s)
{
$con = mysqli_connect("localhost","root","","collofnursing");
//mysql_select_db("collofnursing");
$res = mysqli_query($con,"select * from condwetreat");
while($row = mysqli_fetch_array($res))
{
echo $s;?> <br><br><?php
}
}
?>
</body>
</html>