Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP / Java Applet

Status
Not open for further replies.

GiffordS

Programmer
May 31, 2001
194
CA
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?
 
I guess I could just write the information to a flat file and have the applet access that file, but that would seem a senseless waste of time.
 
Plus there is no guaranty files would work in a multi-user environment.

Is this a server-side applet, or a client-side applet?
______________________________________________________________________
TANSTAAFL!
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top