Not sure if this is a PHP problem or not... (newbie)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Stringy
Forum Newbie
Posts: 1
Joined: Wed Jul 13, 2005 3:50 am

Not sure if this is a PHP problem or not... (newbie)

Post by Stringy »

Bonjour.

I have an applet that runs on a webpage which is a 3d visualisation that opens a file for viewing depending on a parameter defined in the html code that runs the applet.

Code: Select all

<P> 
<APPLET CODE=&quote;Magelet.class&quote; ARCHIVE=&quote;magejava.jar&quote; ALIGN=&quote;bottom&quote; WIDTH=&quote;630&quote; HEIGHT=&quote;450&quote;> 
<PARAM NAME=&quote;kinemage&quote; VALUE=&quote;XXXX&quote;> 
</P>

Now I know very little about web coding, and as such I was wondering how it would be possible to have a menu of some sort that defines what XXXX is going to be. The reason I want to do this is so that I don't have lots and lots of duplicate pages just so that I can load up different files, just the one page that can open them all.

This leads me onto my next question:
If the above is possible (and I suspect it is), what way would it possible to have, I suppose, a script, which will look in the contents of a directory, and return the contents as the options in the menu I would like to create above.

Thanks for any help I receive on this as it would be muchly appreciated.
Ta.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You could use a little php.. Now all you need is generate a menu with

applet.php?kinemage=somevalue
appliet.php?kinemage=othervalue

Code: Select all

if (!isset($_GET['kinemage']))
{
  $kinemage = 'default';
}
else
{
  $kinemage = $_GET['kinemage'];
}

echo "<P>";
echo "<APPLET CODE='Magelet.class' ARCHIVE='magejava.jar' ALIGN='bottom' WIDTH='630' HEIGHT='450'>";
echo "<PARAM NAME='$kinemage' VALUE='{$kinemage}'>";
echo "</P>";
Post Reply