I'm probably over-thinking this, but here's the question anyway. I'm calling a Java Applet from a PHP generated page. How can I make PHP session variables available to the applet?
You can set the name of the cookie PHP uses to store the index to the session data. If you can get Java to react to that cookie name and deserialize the data, you should be able to access it. ______________________________________________________________________
TANSTAAFL!
Actually, I was thinking it would be easier to pass the variable in a PARAM tag of the applet. Just not quite sure how because PHP would generate the applet ahead of the parameter. Any idea?
It's client side. I'm wondering now if I can't just use the onLoad() JS function to start the applet after the page is loaded. That would give PHP time to fill in all of the variables in the PARAM tag of the applet.
Unless you have experience to the contrary, I wouldn't worry about it. The browser should wait until the closing tag for the object inclusion before invoking the applet. ______________________________________________________________________
TANSTAAFL!
Yeah, I realized that as I was typing that last reply. The entire page generates before anything else. I said I was probably over-thinking it. I do that sometimes.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.