SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    huge problem with PHP, flash, internet explorer

    I'm having a problem where Internet explorer will not read my php variables from flash.

    I have a navigation that I built in Flash actionscript. The navigation then reads a PHP file that will check if the login cookie has been set and if its set it send the variables in _GET form. "acces=0&type=0"...
    When I run this in google chrome it works fine. I log in the page refreshes and the navigation changes to display the new members navigation. When I do this in Internet explorer the navigation doesn't change even though the user is logged in and his username is displayed in the top right hand corner of the HTML page. Anyone have any ideas why this is happening. I have seen it randomly work but most of the time it doesn't.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay after posting this I was pretty frustrated and did what any smart programmer would do when facing a giant brick wall... I turned around went for a break to get something to eat and when I came back I realized it was most likely a caching error (don't know how I didn't think of this before)... So I did a little search on google for disable flash variable caching and found nothing useful... so I narrowed my search to "actionscript 3.0 disable variable chaching" and surely enough... problem solved.

    Code PHP:
    header('Content-type: application/x-shockwave-flash');
    header('Expires: Thu, 01 Jan 1970 00:00:00 GMT, -1');
    header('Cache-Control: no-cache, no-store, must-revalidate');
    header('Pragma: no-cache');

    I got that tid bit of information which fixed it all up. They also suggested that I trick flash into thinking that each time it requests info it is requesting it from a new URL. They suggested I use this code for that.

    Code Actionscript:
    var request:URLRequest = new URLRequest("whateverurl?nocache=" + new Date().getTime());

    I tested it and it worked by simply adding the PHP section. However I will also add in the additional flash code just for extra security from any future browser caching problems.
    Hope this helps someone in the future.


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
  •