Can i use PHP varables inside a HTML tag like this?
because it won't load the applet
EDIT!
I just looked at the source code produced in Mozilla Here is the HTML...
The variables seem to work fine
Here is my PHP code...
I have the HTML page and the HelloWorldApp.class in the same directory. It might not be a PHP problem, i dunno?!?
Can anyone see why the applet won't work?
The error message in the applet says it cannot find HelloWorldApp.class
Thanks
Neilos
| Code: |
| <applet code=<?php echo $link; ?>.class name=<?php echo $link; ?> archive=<?php echo $link; ?>.jar width=300 height=300>
<param name="bgcolor" value="ffffff"> <param name="fontcolor" value="000000"> Your browser is not Java enabled. </applet> |
because it won't load the applet
EDIT!
I just looked at the source code produced in Mozilla Here is the HTML...
| Code: |
| <html>
<head></head> <body> <h2>You chose to play:</h2> Hello World<br /> <applet code=HelloWorldApp.class name=HelloWorldApp archive=HelloWorldApp.jar width=300 height=300> <param name="bgcolor" value="ffffff"> <param name="fontcolor" value="000000"> Your browser is not Java enabled. </applet> <br /> Click to return to <a href="java.html">Java Applets</a>. </body> </html> |
The variables seem to work fine
Here is my PHP code...
| Code: |
| <html>
<head></head> <body> <?php // get form selection $whichGame = $_GET['whichGame']; // check value and select appropriate item if ($whichGame == 1) { $game = 'Hello World'; $link = 'HelloWorldApp'; } elseif ($whichGame == 2) { $game = 'Game 2'; $link = 'Game2'; } elseif ($whichGame == 3) { $game = 'Game 3'; $link = 'Game3'; } else { $game = 'Game 4'; $link = 'Game4'; } ?> <h2>You chose to play:</h2> <?php echo $game; ?> <br /> <applet code=<?php echo $link; ?>.class name=<?php echo $link; ?> archive=<?php echo $link; ?>.jar width=300 height=300> <param name="bgcolor" value="ffffff"> <param name="fontcolor" value="000000"> Your browser is not Java enabled. </applet> <br /> Click to return to <a href="java.html">Java Applets</a>. </body> </html> |
I have the HTML page and the HelloWorldApp.class in the same directory. It might not be a PHP problem, i dunno?!?
Can anyone see why the applet won't work?
The error message in the applet says it cannot find HelloWorldApp.class
Thanks
Neilos
