Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading Multiple pages on the same page in PHP
    text
    copied!<p>I am relatively new to PHP.. For my web page, I need to load multiple pages in the same page.. as in I have a basic HTML page named cwt.html which has all the checkboxes and submit button. Once the Submit button is clicked, the next page(say processing.php) associated for the selected check-boxes(of cwt.html) should also be loaded in the same page.. </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt; Conditions We Treat &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id = form1 action = "processing1.php" method = "post"&gt; &lt;input type = "checkbox" name = "sickness[]" value = "Nausea"&gt;Nausea&lt;/input&gt;&lt;br/&gt; &lt;input type = "checkbox" name = "sickness[]" value = "Constipation"&gt;Constipation&lt;/input&gt;&lt;br/&gt; &lt;input type = "checkbox" name = "sickness[]" value = "vomiting"&gt;Vomiting&lt;/input&gt;&lt;br/&gt; &lt;div id = "submit1"&gt;&lt;input type = "submit" name = "submit" value = "submit"&gt;&lt;/input&gt;&lt;/div&gt;&lt;br/&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Once the submit button is clicked in this web page, the control should head to processing1.php, but the content has to be loaded in the same page</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt; Conditions We Treat &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?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;?&gt; &lt;br&gt;&lt;br&gt;&lt;?php } } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload