Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2003
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Positioning the window

    Hello everybody,

    I display records on a page from a table using PHP and theres a link called "Contact the person"When i click on this link, i want to open a new page and this page has to be centered on the window.This code is working fine in another application of mine but does'nt seem to work here.Could somebody please tell me why this does'nt work.

    Thanks in advance

    On the first page i've this code:
    PHP Code:
    echo"<tr>";
    echo
    "<td width='50%'><a href='contactform.html' target='_blank'>Contact the Person</a>";
    echo
    "</tr>"
    and now when i click on contact the person, the page contactform.html opens and here is the code for that.
    PHP Code:
    <html>

    <
    head>
    <
    meta http-equiv="Content-Language" content="en-us">
    <
    meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <
    meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <
    meta name="ProgId" content="FrontPage.Editor.Document">
    <
    title>Contact Page</title>

    <
    script type="text/javascript">

    function 
    openWindow(theURL,winName,featuresmyWidthmyHeightisCenter) { 
      if(
    window.screen)if(isCenter)if(isCenter=="true"){ 
        var 
    myLeft = (screen.width-myWidth)/2
        var 
    myTop = (screen.height-myHeight)/2
        
    features+=(features!='')?',':''
        
    features+=',left='+myLeft+',top='+myTop
      } 
      
    window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight); 


    </script>
    </head>

    <body bgcolor="#FFFFCC">

    <table border="1" width="100%">
      <tr>
        <td width="50%">Your name</td>
        <td width="50%">
          <p><input type="text" name="T1" size="20"></p>
          </td>
      </tr>
      <tr>
        <td width="50%">Your text</td>
        <td width="50%"><input type="text" name="T2" size="20"></td>
      </tr>
      <tr>
        <td width="50%">Your description</td>
        <td width="50%">
          <p><textarea rows="2" name="S1" cols="20"></textarea></p>
          
        </td>
      </tr>
    </table>

    <table border="1" width="100%">
      <tr>
        <td width="100%"><input type="submit" name="submit" value="enter"></td>
      </tr>
    </table>

    </body>

    </html> 

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.codingforums.com/showthre...ghlight=center

    look in there and ignore my code.


  •  

    Posting Permissions

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