SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Nov 2002
    Location
    Maryland
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using PHP in Pop up Window

    I want to use a PHP include in a pop up window, but the problem is the pop window that is created does not have a php extension so the php include won't execute. How do I make the pop up window execute the php include?

    Any help is greatly appreciated....Thanks

    Here is the javascript that I am using to create a new window:

    function goldframe(sFile, iWidth, iHeight, sTitle)
    {
    var wGraphic=window.open('','_blank','width='+parseInt(iWidth+100)+',height='+parseInt(iHeight+160)+',toolbars=no,resize=no,');

    wGraphic.document.write('<html>\n<head>\n\n');

    wGraphic.document.write('<title>Nassau Gallery</title>\n<link rel="stylesheet" type="text/css" href="../style.css">\n');

    wGraphic.document.write('<?php require\("../silver_frame.inc"\)\;?></head>\n');

    .......

    wGraphic.document.write('</table>\n</body>\n</html>\n\n');

    return null;

    }

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put all the header, title, style sheet links into a file called whatever.php then use your window.open function to open the whatever.php file to the exact size you specify, passing along the value of sTitle.

    Code:
    function goldframe(sFile, iWidth, iHeight, sTitle)
    {
    var wGraphic=window.open('whatever.php?sTitle=' + sTitle,'_blank','width='+parseInt(iWidth+100)+',height='+parseInt(iHeight+160)+',toolbars=no,resize=no,');
     
    }
    whatever.php :
    <html>...

    <title><?php echo($sTitle); ?></title>

    ...
    Quote Originally Posted by JeffGSR
    I want to use a PHP include in a pop up window, but the problem is the pop window that is created does not have a php extension so the php include won't execute. How do I make the pop up window execute the php include?

    Any help is greatly appreciated....Thanks

    Here is the javascript that I am using to create a new window:

    function goldframe(sFile, iWidth, iHeight, sTitle)
    {
    var wGraphic=window.open('','_blank','width='+parseInt(iWidth+100)+',height='+parseInt(iHeight+160)+',toolbars=no,resize=no,');

    wGraphic.document.write('<html>\n<head>\n\n');

    wGraphic.document.write('<title>Nassau Gallery</title>\n<link rel="stylesheet" type="text/css" href="../style.css">\n');

    wGraphic.document.write('<?php require\("../silver_frame.inc"\)\;?></head>\n');

    .......

    wGraphic.document.write('</table>\n</body>\n</html>\n\n');

    return null;

    }

  3. #3
    SitePoint Addict
    Join Date
    Nov 2002
    Location
    Maryland
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Holmescreek, Thanks for the response! I did what you said and it works great.

    Thanks again...Jeff


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •