Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading a complete HTML Page in Modal Box using php code only

Tags:

php

I have multiple HTML file. I want to display this file content in modal box base on condition. I do not want to use iframe and javascript or jquery. So It is possible from php side only?

Example:

<div class="modal  fade bd-example-modal-lg shopify-onload-popup" id="defaultPopup-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered  modal-lg" role="document">
        <div class="modal-content">
            <?php
            if ($variable == 1) {
                ?>
                <!-- Loade file1.html -->
                <?php
            } else {
                ?>
                <!-- Loade file2.html -->
                <?php
            }
            ?>
        </div>
    </div>
</div>
like image 494
tejash patel Avatar asked Nov 28 '18 05:11

tejash patel


1 Answers

you can use PHP include function like this

  <?php
       if ($variable == 1) {
           include "file1.php";
       } else {
           include "file2.php";
       }
   ?>
like image 172
uttam_devani Avatar answered Oct 06 '22 01:10

uttam_devani