Brent wrote:
> http://www.almonte.com/cards/
> What I'm trying to figure out is how to make the display of the console
> and accompanying text *conditional*; that is, if the field
> 'midifile' returns
> a value other than null, display them, otherwise don't. Can't
> seem to get
> the syntax right...
>
> Below is the Javascript that launches the MIDI file, and after that the
> relevant HTML that displays the song name
>
> <!--
> if(navigator.userAgent.indexOf("MSIE") != -1)
> document.writeln ('');
> else
> document.writeln ('<EMBED SRC="$BASEURL/$fields{'midifile'}"
> AUTOSTART="true" HIDDEN="false" VOLUME="50" WIDTH="145"
> HEIGHT="15" VOLUME="50" CONTROLS="smallConsole">');
> //-->
>
> [snip]
> Current music file:<br>
> <a href=$BASEURL/$fields{'midifile'}>
> $fields{'midifile'}
> </a>
> <br>(Right-click to save to your disk)
Well, while I'm listening to Air on the G string....
In your perl script, try:
# all the scripting stuff before your [snip] goes
# first, since that appears to be working correctly.
# The line numbers shown are for instructional poipusses,
# cut them out when you try the code
1. $midifile = $fields{'midifile'};
2. if ($midifile ne ''){
3. print qq(
4. Current music file:<br>
5. <a href="$BASEURL/$midifile">$midifile</a><br>
6. (Right-click to save to your disk)
7. );
8. }
Steps:
1. set the midifile variable so it's easier to refer to
2. check to see if the $midifile variable is not
empty (not equal to an empty string). If it's not:
3. define where you're going to start printing.
Put your HTML here. You can use $variables and Perl will
recognize them by their $ sign (or @ symbol). If you want
to use a $ symbol and have it look like a dollar symbol,
escape it by putting a \ before it, like this: \$45.00.
Same with an @ symbol.
4-6 Your HTML
7. close the print qq( statement
8. close the if...{ statement
Let me know if that works for you or not. You'll probably have to close the
print statement that creates the HTML before the new code. You'll have to
"reopen" the print statement to print any HTML that follows the new code.
Jack
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------