Java applet in a php page?

I want to run a java applet inside a php message board. From my research it seems mixing java inside a php page is really tricky. Is this true?

Should I find a message board written in Java or JSP or something? Would that be easier to combine the two?

Thanks.
Matt

Why don’t you try switching back to HTML and running the applet from that. Then maybe you can switch back to PHP.

I have it running fine in html. Now I am trying to put it in a php page.

Have you tried breaking the php, inserting the HTML and then restarting the PHP?

?>INSTRECODEHERE <?

My knowledge of PHP is quite limited but if that doesn’t work…there should be a part of the code that contains HTML…just insert the applet code there.

Ok figured it out. All i needed to do what exit the php script and restart it. You know:

?>

insert script

<?php

PHP and Java applets are completely separate and there is no reason they would interact (and in fact, no means by which they could interact other than the applet making its own HTTP queries to the server). PHP is server-side code that outputs HTML and data to the client. Part of that HTML markup can include an object or embed tag to instruct the browser to load an applet. The applet then runs on the client side, not even the same machine that’s processing the PHP. Your solution of exiting the script will work fine, as will using an echo command in PHP to output the appropriate tags for the applet. On my pages, I use echo tags because I use the PHP to include some user-specific parameters to the applet tag. I suspect any difficulty you might have had generating the object/embed tag in PHP was just handling the quote marks.

This may be belaboring the point, but it’s important to realize that the code running on the server (PHP, JSP, Java servlet, ASP, CGI, plain HTML, whatever) has no effect or interaction with the applet running on the client. As long as the server-side code can output HTML, it can output the object or embed tag you want to use for the applet, and that’s all the browser running the applet cares about.

Meros and Micco, Thank you so much for your help.

Micco I GREATLY appreciate the details you shared with me. It is really helpful!

Matt