Problem with PHP Server-Side Script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amanda H.

    Problem with PHP Server-Side Script

    I got the JS fix I needed earlier, but now I have another problem. For
    some reason, I cannot get my PHP script for style switching to be
    recognized by any browser except Safari, which is ridiculous. I got it
    from http://www.webligo.com/products_styles.php and it has been the
    only PHP style switcher script that has worked thus far for me on any
    browser.

    Here is the test site: http://www.amandahenson.com/testsite/

  • Janwillem Borleffs

    #2
    Re: Problem with PHP Server-Side Script

    Amanda H. wrote:[color=blue]
    > I got the JS fix I needed earlier, but now I have another problem.
    > For some reason, I cannot get my PHP script for style switching to be
    > recognized by any browser except Safari, which is ridiculous. I got
    > it from http://www.webligo.com/products_styles.php and it has been the
    > only PHP style switcher script that has worked thus far for me on any
    > browser.
    >
    > Here is the test site: http://www.amandahenson.com/testsite/
    >[/color]

    I compared the winter and dirty styles, and there's no difference. Perhaps
    you are relying on register_global s being enabled, while they are not.

    When register_global s are disabled, you should reference $_GET['style']
    instead of $style...


    JW


    Comment

    • Amanda H.

      #3
      Re: Problem with PHP Server-Side Script

      Hey there JW.

      I haven't set up the layout for any of the styles except for OFF,
      BLOOM, and BASIC. All the rest exhibit the OFF style. I am pretty
      sure the globals are enabled but I'll check. Thanks for the help :)

      Amanda H.

      Comment

      • Amanda H.

        #4
        Re: Problem with PHP Server-Side Script

        I checked the globals, and they were off, but is now on and seems to
        make no difference. I checked the PHP and it is using $_GET so who
        knows? Seriously, if anyone knows, tell me :).

        Amanda H.

        Comment

        • Janwillem Borleffs

          #5
          Re: Problem with PHP Server-Side Script

          Amanda H. wrote:[color=blue]
          > I checked the globals, and they were off, but is now on and seems to
          > make no difference. I checked the PHP and it is using $_GET so who
          > knows? Seriously, if anyone knows, tell me :).
          >[/color]

          I ran the examples and although they work, FireFox complaints about an
          invalid MIME type.

          To fix this, at the beginning of the file, add: the following on the top of
          the styleswitcher.p hp script (just after the opening PHP-tag):

          header('Content-Type: text/css');

          BTW, did you get the text examples to work? If you did, you check the
          differences between the implementations .


          JW


          Comment

          • Amanda H.

            #6
            Re: Problem with PHP Server-Side Script

            It is working *better* now overall. The only problem is that not all
            of the browsers are refreshing when the theme is selected. Working:
            Safari, Firefox, Netscape. Not refreshing: Opera, IE/Win. IE/Mac
            doesn't look pretty, but I'm not going to worry about it right now :)

            The header copy worked right, and made the other browsers recognize.
            So have you been up all night, or is it just me?

            Amanda H.

            Comment

            • Jim Michaels

              #7
              Re: Problem with PHP Server-Side Script

              the browser knows it's done with headers when it receivs a blank line. try
              echoing a "\n" after your header() and see if that helps any.

              "Amanda H." <mandyhenson@gm ail.com> wrote in message
              news:1139668745 .764243.214490@ z14g2000cwz.goo glegroups.com.. .[color=blue]
              > It is working *better* now overall. The only problem is that not all
              > of the browsers are refreshing when the theme is selected. Working:
              > Safari, Firefox, Netscape. Not refreshing: Opera, IE/Win. IE/Mac
              > doesn't look pretty, but I'm not going to worry about it right now :)
              >
              > The header copy worked right, and made the other browsers recognize.
              > So have you been up all night, or is it just me?
              >
              > Amanda H.
              >[/color]


              Comment

              • Janwillem Borleffs

                #8
                Re: Problem with PHP Server-Side Script

                Amanda H. wrote:[color=blue]
                > So have you been up all night, or is it just me?
                >[/color]

                In my time zone, it was in the afternoon, so it's just you ;-)


                JW


                Comment

                Working...