SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I pass variable from called window to caller window?

    Hello,
    First I apologize that I posted this thread in the Javascript forum as well,
    but please forgive me because I am urgent.

    Here is a situation.
    In page1.php there are 3 text boxes and if one of them is entered and ok button is pressed, it should bring another window(managerPassword.php) and ask a manager password.
    If right manager password is entered in the window(managerPassword.php), it will close and the page1.php should proceed the next steps.

    I managed to succeed to open another window(managerPassword.php) from the first page(page1.php) and check the right manager password and close the window, but even this window is closed, the calling page(page1.php) doesn't know about anything happened in the managerPassword.php

    So how can I make that happen so if the right manager password is entered at the managerPassword.php then it will close and page1.php knows that the right password is entered somehow and proceeds the next steps?

    Thanks for your advice.

  2. #2
    SitePoint Guru gavwvin's Avatar
    Join Date
    Nov 2004
    Location
    Cornwall, UK
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    after your php checks that the password is ok, output something like:
    Code:
    <html>
    <body>
    <script type="text/javascript">
    window.opener.location = 'next_step.php';
    window.close();
    </script>
    </body>
    </html>
    This should redirect the parent window and close the popup

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.
    The solution works partially, but here is the situation.
    when child window calls back caller page(page1.php),using

    <html>
    <body>
    <script type="text/javascript">
    window.opener.location = 'page1.php';
    window.close();
    </script>
    </body>
    </html>

    page1.php should remember the previous status of some variable before it calls child window.

    Then, what is the best solution to keep those variable?
    Passing from page1.php->managePassword.php->page1.php ?
    Or keep in the $_SESSION before calling managePassword.php?

    Thanks


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
  •