Web Analytics Made Easy -
StatCounter Can PHP make a popup window? - CodingForum

Announcement

Collapse
No announcement yet.

Can PHP make a popup window?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can PHP make a popup window?

    I am not a big fan of popup windows, but some times they are necessary. I have a popup window configured using a JavaScript, but those that do not have Java enabled, will not be able to view it. I was wondering if there is a PHP version of this task?

    Thank you in advance,

    Kim

  • #2
    1. Java != Javascript. They are completely different languages.
    2. You cannot create any type of browser manipulation using php. You can however send the request for the desired information over the querystring.

    Hope that answers your question. HTML is capable of creating new windows as well, so if the javascript fails you can use html as a backup.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

    Comment


    • #3
      Thanks for the reply. I didnt know that if I have java disabled that javascript would still work. As for HTML opening a new window, I know I can do that, but I havent figured out how to make the window open up in a specific size. Is this possible with just the _blank command?

      Thanks,

      Kim

      Comment


      • #4
        Originally posted by KimHuff
        Thanks for the reply. I didnt know that if I have java disabled that javascript would still work. As for HTML opening a new window, I know I can do that, but I havent figured out how to make the window open up in a specific size. Is this possible with just the _blank command?

        Thanks,

        Kim
        If you have java disabled then java applets will not work, if you have javascript disabled then javascript will not work. As was mentioned java and javascript are not the same thing.

        In order to create a typical popup window you need javascript. PHP cannot do this. PHP is a server side language.
        Spookster
        CodingForum Supreme Overlord
        All Hail Spookster

        Comment


        • #5
          Spookster,

          Thanks so much for the clarification.

          Kim

          Comment


          • #6
            Originally posted by KimHuff
            Thanks for the reply. I didnt know that if I have java disabled that javascript would still work. As for HTML opening a new window, I know I can do that, but I havent figured out how to make the window open up in a specific size. Is this possible with just the _blank command?

            Thanks,

            Kim
            Code:
            <a href = "popup.html" target = "_blank" onclick="popupCode();return false;" >
            should open a popup if you've got javascript on otherwise open in a blank window
            http://www.hazelryan.co.uk

            Comment


            • #7
              Yeah, as above there. However, you cannot, to my knowledge, use html to specify the window sizes.
              You could always force your clients to use javascript though. Simply create an included file which would use javascript to set a cookie, and validate it from that point. If the cookie exists, continue with access. If not, send them to a 'javascript must be on to view this site'. Unfortunatly, unless its something that they absolutly need to see or do, they will probably surf away in search of a similar website. So keep that in mind as well, many more people are denying their browsers from using javascript (for good reasons as well).
              PHP Code:
              header('HTTP/1.1 420 Enhance Your Calm'); 
              Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

              Comment


              • #8
                Originally posted by Fou-Lu
                Yeah, as above there. However, you cannot, to my knowledge, use html to specify the window sizes.
                You could always force your clients to use javascript though. Simply create an included file which would use javascript to set a cookie, and validate it from that point. If the cookie exists, continue with access. If not, send them to a 'javascript must be on to view this site'. Unfortunatly, unless its something that they absolutly need to see or do, they will probably surf away in search of a similar website. So keep that in mind as well, many more people are denying their browsers from using javascript (for good reasons as well).
                How aboud JS enabled and cookies disbled?
                I'm not sure if this was any help, but I hope it didn't make you stupider.

                Experience is something you get just after you really need it.
                PHP Installation Guide Feedback welcome.

                Comment


                • #9
                  Originally posted by marek_mar
                  How aboud JS enabled and cookies disbled?
                  Lol
                  In that case, there isn't really any way to validate it I suppose, at least using php. I would figure that people are more likely to have javascript off and cookies on than the other way around.
                  Instead, tell clients both cookies and javacript need to be enabled. Problem solved
                  PHP Code:
                  header('HTTP/1.1 420 Enhance Your Calm'); 
                  Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

                  Comment

                  Working...
                  X