To get the window name using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mandarchalke29
    New Member
    • Oct 2007
    • 7

    To get the window name using PHP

    Dear sir,

    I have created a windows using javascript's window.open method. So is there any method by which i can get the name of that window using PHP.

    Mandar
  • RuthC
    New Member
    • Nov 2007
    • 33

    #2
    Originally posted by mandarchalke29
    Dear sir,

    I have created a windows using javascript's window.open method. So is there any method by which i can get the name of that window using PHP.

    Mandar
    Hi,
    u can use $_SERVER['REQUEST_URI'] to get the current url.

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, Mandar.

      Do you mean the content of the <title> tag in the HTML?

      If you mean the name of the variable that points to the window object... even JavaScript can't do that.

      Comment

      • spudse
        New Member
        • Jan 2008
        • 11

        #4
        The name of the windows is only available client-side I suppose. PHP can't communicate with a client-side language like Javascript (well it could when you use ajax, but I don't think that is what you are looking for).

        What you could do is add the window name to the url that is used by this window, for instance "http://www.yourdomain. com/window.php?name =theName".

        You can know access this name with:
        [code=php]echo $_GET[theName][/code]

        Comment

        • envisioneer
          New Member
          • Jan 2008
          • 1

          #5
          Originally posted by mandarchalke29
          Dear sir,

          I have created a windows using javascript's window.open method. So is there any method by which i can get the name of that window using PHP.

          Mandar
          Depending on what you are trying to achieve...

          you could use js to assign the window name as a text value to a blank hidden input field, e.g. document.formna me['hiddenInput'].value = 'windowName';
          submit the form and pick up the name in PHP from the POST/GET array.

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by spudse
            The name of the windows is only available client-side I suppose. PHP can't communicate with a client-side language like Javascript (well it could when you use ajax, but I don't think that is what you are looking for).

            What you could do is add the window name to the url that is used by this window, for instance "http://www.yourdomain. com/window.php?name =theName".

            You can know access this name with:
            [code=php]echo $_GET[theName][/code]
            [code=php]echo $_GET[name][/code]
            ;)

            Comment

            Working...