#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    7
    Rep Power
    0

    How to display a page as a popup window


    How to display a web page as a popup window without all the bars (menu bar,address bar,etc) when you click on the input type submit button using php code or combining with javascript.help pls
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,230
    Rep Power
    593
    A popup is not done with PHP per se since it is server side. There are a couple of way to do popups. One is with Javascript and window.open. The other is an HTML <a> tag (which could have an href to a PHP script) using the 'target=_blank' attribute. The latter requires a mouse click while the former can be done with any type of Javascript trigger. As for what menus are displayed, that is controlled by the browser. You may be able to suppress them with Javascript's window.open settings parameters but most browsers ignore that anyway unless permitted by the user settings. It is very difficult to override browser settings with Javascript and even harder with PHP/HTML. It is mostly a matter of security.
    Last edited by gw1500se; March 7th, 2013 at 07:06 AM.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Mad Scientist
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2007
    Location
    North Yorkshire, UK
    Posts
    3,660
    Rep Power
    4123
    popups can be blocked with a popup blocker

    more elegant are iframed modal boxes (eg jquery iframe modal window)

    That's the javascript sorted

    Onto the PHP

    code your php page up to take an optional URL argument which then only creates the middle part of your page (eg without headers and footers)

    then for example, consider this:

    /page.php?iframed=yes

    PHP Code:
    <?php
    $full 
    true;

    if(
    $_GET['iframed'] =='yes') {
         
    $full false;
    }

    ?>
    <html>
        <head>
            .....
        </head>
        <body>
            <?php if($full) { ?>
                <div id='header'>
                    ....
                </div>
            <?php ?>

            ....
            
            <?php if($full) { ?>
                <div id='footer'>
                    ....
                </div>
            <?php ?>
        </body>
    </html>
    I said I didn't like ORM!!! <?php $this->model->update($this->request->resources[0])->set($this->request->getData())->getData('count'); ?>

    PDO vs mysql_* functions: Find a Migration Guide Here

    [ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]

IMN logo majestic logo threadwatch logo seochat tools logo