PDA

View Full Version : passing parameters via ssi/xssi


Benson
11-25-1999, 12:39 AM
I'm probably barking up the wrong tree with this idea, but is there some way to pass different parameters to the applet via ssi or xssi?[nbsp][nbsp]I'd like to have two or three different groups of parameters that could be passed to the applet based on the day of the week for instance.

<td><applet code=&quot;tinyImageCycle.class&quot; width=&quot;233&quot; height=&quot;147&quot;>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]<param name=&quot;IMAGE1&quot; value=&quot;./images/phuza.gif&quot;>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]<param name=&quot;IMAGE2&quot; value=&quot;./images/wicker.gif&quot;>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]<param name=&quot;IMAGE3&quot; value=&quot;./images/jack_cox.gif&quot;>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]<param name=&quot;IMAGE4&quot; value=&quot;./images/linprint.gif&quot;>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]<param name=&quot;IMAGE5&quot; value=&quot;./images/enigma7.gif&quot;>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]<param name=&quot;DELAY&quot; value=&quot;4000&quot;>
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]<param name=&quot;PRELOAD&quot; value=&quot;1&quot;>
[nbsp][nbsp]</applet></td>

Benson
11-27-1999, 07:19 AM
No ideas, anyone?

Bartoni
11-27-1999, 11:45 AM
You could use javascript, and probably PHP. As I'm very new to PHP here's, off the top of my head, how you could pass different params depending on a condition in javascript:

<html>
blah blah blah...
<script language=&quot;Javascript&quot;>
document.write(&quot;<applet code=\&quot;tinyImageCycle.class\&quot; width=\&quot;233\&quot; height=\&quot;147\&quot;>&quot;);
if(date==whatever)[nbsp][nbsp]// your condition here
{
[nbsp][nbsp]document.write(&quot;<param name=\&quot;IMAGE1\&quot; value=\&quot;./images/whatever1.gif\&quot;>&quot;);
}
else
{
[nbsp][nbsp]document.write(&quot;<param name=\&quot;IMAGE1\&quot; value=\&quot;./images/whatever2.gif\&quot;>&quot;);
}
document.write(&quot;</applet>&quot;);
//-->
</script>

.. blah blah blah
</html>

Hunkorama417
11-27-1999, 01:18 PM
in Javascript the correct way would be:

<script language=javascript>
var now = new Date();
var day = now.getDay();

document.write('<applet code=&quot;tinyImageCycle.class&quot; width=&quot;233&quot; height=&quot;147&quot;>');

if (day == &quot;0&quot;) document.write('<param name=&quot;IMAGE1&quot; value=&quot;./images/phuza.gif&quot;>'); //do this if Sunday
else if (day == &quot;1&quot;) document.write('<param name=&quot;IMAGE2&quot; value=&quot;./images/wicker.gif&quot;>'); //do this if Monday

document.write(&quot;</applet>&quot;);
//-->
</script>

Good luck...<!-- NO_AUTO_LINK -->
------------------
-Don't worry, perfection isn't for everyone.

Justin
11-28-1999, 12:00 AM
Actually I think in JavaScript you would need to use, for example, Date.UTC() (case sensitive) - &quot;date&quot; is not a built in variable or function that I know of, at least not as far back as JS 1.2...?

In PHP, you could do something like:

if (time() < 9288521) {
[nbsp][nbsp] print &quot;<param name=\&quot;IMAGE1\&quot; value=\&quot;./images/thisweek.gif\&quot;>\n&quot;;

} elseif (time() < 9288891) {
[nbsp][nbsp] print &quot;<param name=\&quot;IMAGE1\&quot; value=\&quot;./images/nextweek.gif\&quot;>\n&quot;;

}

And so on... replace the 92358215 numbers above with the Unix time stamp of whatever date/time you need... Not sure if this helps or not...
[nbsp]
------------------
Justin Nelson
FutureQuest Support