SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2002
    Location
    Burnaby, BC
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having PHP load open pre-sized window?

    I have a html form that someone fills out. Then on "submit" a php script reads what was typed in the form. It then opens a new page with a html page in it with the results.
    I would like this page to load as a pre-sized window (ie. 200 X 400pixels). How?
    This is how I have it loading the new page:
    PHP Code:
    $file "../../../directory/filename.htm";
    $read fopen($file"r");
    $content fread($readfilesize($file));
    $content ereg_replace("{VIN}"$VIN$content);
    $content ereg_replace("{make}"$make$content);
    $content ereg_replace("{serial}"$serial$content);
    echo 
    $content
    I would like this to pop open a pre-sized window rather than an entirely new page..
    Thanks.

  2. #2
    orange pips! orange pips!
    Join Date
    Oct 2001
    Location
    Its all about location
    Posts
    652
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this may be more of a javascript question. Perhaps it can be done in php, but I don't know how. In javascript, it can be accomplished as such:

    Create the javascript function (the box may say PHP Code but it's really javascript code)
    PHP Code:
    function NewWindow(mypage,myname,w,h)
    {
     
    LeftPosition = (screen.width) ? (screen.width-w)/0;
     
    TopPosition = (screen.height) ? (screen.height-h)/0;
     
    settings 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no';
     
    win window.open(mypage,myname,settings)

    Use the function in a link
    Code:
     
    <a href="#" onclick="NewWindow('popupForm.html','popUp','500', '315')">click me</a>


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
  •