#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Netherlands
    Posts
    8
    Rep Power
    0

    Question popup window doesn't work??? (PHP and Javascript)


    Hi, I just want to open a page in a popup window without all bars...
    I'm using the script below....but it doensn't open a popup window....can somebody help me with this?
    I'm totally no Javascript expert!
    So please use examples...

    In this script I'm also using some php because there has to be some variables send with the link to the popup page. (sorry about my english, it's not my native language)

    =================CODE===================
    <html>
    <head>

    <script>
    function popup_mailfriend()
    {mailfriend = window.open('send_to_friend.php', 'width=500,height=500,toolbar=0,scrollbars=0,location=1,statusbar=1,menubar=0,resizable=1,titlebar=1
    ')
    mailfriend.focus();
    }
    </script>

    </head>
    <body>

    <?
    echo "<a href='", "send_to_friend.php?section=$section&topic=$topic&subtopic=$subtopic&subsubtopic=$subsubtopic";

    echo "' onCLick='popup_mailfriend()'>Email this page to a friend</a>";
    ?>

    </body>
    </html>
    ===============END CODE================

    Thanks in advance for your help.

    - Boszy -
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Australia
    Posts
    10
    Rep Power
    0
    Hi, try this code:
    PHP Code:
    <html><head><script>
    function popup_mailfriend(urlvars) {
     var mailfriend = window.open('send_to_friend.php?'+urlvars, '', 'toolbar=0,scrollbars=0,location=1,statusbar=1,menubar=0,resizable=1,titlebar=1,width=500,height=500');
     mailfriend.focus();
    }
    </script></head><body>
    <?
    echo "<a href='' onCLick=\"popup_mailfriend('$section&topic=$topic&subtopic=$subtopic&subsubtopic=$subsubtopic'); return false;\">Email this page to a friend</a>";
    ?>
    </body></html>
    -=-=-=-=-=-=-=-=-=-=-=-=-
    PHP Scripts n Stuff
    http://www.bcnstech.net/
    -=-=-=-=-=-=-=-=-=-=-=-=-

IMN logo majestic logo threadwatch logo seochat tools logo