You must Sign In to post a response.
  • Category: HTML

    How to create modal dialog box in php?


    how to create modal dialog box in php?
  • #748766
    With the help of ShowModalDialog method in javascript you can show modal popup
    see below snippet to check how to show it
    showModalDialog method, Creates a modal dialog box that displays the specified HTML document.

    window.showModalDialog("test.htm", "_blank")

    There are many parameters we can pass to modal dialog, refer below link for more detail

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #748767
    You should go with jQuery or Javascript popup dialogue.

    Try to explore more about jQuery popup dialogue in google.
    I am giving you some reference links take a look.

    Nirav Prabtani (Senior Web Developer)
    Email :
    blog :

  • #748788

    As you are aware we are mostly on .NET and Microsoft technologies. For quick answer you may post this in any of the PHP forums.
    Here you go for the sample code and detailed explanation:

    Asheej T K

  • #748831

    You can try the following code:-

    If ($phpcondition) {
    <script language='Javascript'>
    blah ='openthepopup.php');


    Or can also try the following code:-

    If ($phpcondition)
    echo "<script>blah ='openthepopup.php')</script>";



    With the above code: "openthepopup.php" is the page which will be opened within the popup window.

    And if you want to decorate the popup window somehow a bit smart, then you can try the following free online tool for the same purpose:-

    Whenever using the above mentioned online tool for decorating the popup window, keep in mind that this tool will produce a code within a hyperlink, so there will a bit more code which you will no need to use. So, you just copy the portion of the code which is like: ",any-value,any-value)"


  • #748848

    Create a hyperlink on which you need to show the modal pop up box-

    <a href="#" class="paulund_modal">Click Here</a>

    Create The JQuery Modal Box Plugin:
    Create a new javascript file and call it jquery.paulund_modal_box.js and save in the same folder as your webpage.

    // Defining our jQuery plugin

    $.fn.paulund_modal_box = function(prop){

    // Default parameters

    var options = $.extend({
    height : "250",
    width : "500",
    title:"JQuery Modal Box Demo",
    description: "Example of how to create a modal box.",
    top: "20%",
    left: "30%",

    //Do stuff here

    return this;


    For the design and other details, please see the below link-

    Hope this will help you !!

    Ashutosh Jha

  • Sign In to post your comments