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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Location
    Greater Indianapolis Area
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question WTK : Popup 101 in PHP environment

    I am looking for a code snippet that could be run in a strict PHP environment to do a window popup. Specifically, I will have a page with a <a href....> where, if clicked, I would like to have a popup in a new window open. I will be passing a variable value along with the <a href link which will run a query to a MySQL table to pull the actual popup window content.

    I'm ok on the PHP and MySQL stuff. I would like a little assistance on the protocol to initiate another window. I'm pretty much JavaScript illiterate.

    TIA,

    IndyTim

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    PHP is a server-side language as such cannot control and aspect of the features of the client-side browser. To open a new window requires either HTML or Javascript and not PHP. It sounds like you wish to use Javascript to open a new window.

    I will move you to the javascript forum.

    Note that many people use pop-up blocking software these days and any pop-pops that are essential to the function of your site may become disabled which will disable your site.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Nov 2002
    Location
    Greater Indianapolis Area
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I fully understand that PHP is client-side. The entire html is being rendered through php, thus my original request. As far as popup blocking again, I am fully aware of the limitations. The application that this would be used in is a corporate environment within an InfraNet. Popup blocking is not an issue here.

    -IndyTim

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Actually PHP is a server-side language. Your web browser will never see a line of PHP code. Once a PHP document is done being parsed by the PHP parser only client-side code such as HTML, Javascript, CSS etc will be outputted to the browser.

    To open a popup window you will use javascripts open() function that is used with the window object.

    window.open() Inside the parenthesis is a number of parameters that you can use to define the file to be opened and the size, location and features of the window being opened.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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