Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if statement

Status
Not open for further replies.

boatguy

Programmer
Oct 22, 2001
153
US
Hi All.

I am helping a collegue to do something I have no business helping with.
We have the following code:
Code:
<% if File01_filename %> 
<a href="%File01_filename%"> 
<img src="%File01_filename%" border=0 width=180 />
</a> 
<% end if %> 
<% if not File01_filename %> 
<% end if %>
This displays an image if the variable file01_filename exists in a flat file. What we now need to do it to check to see if the file01_filename extension is .doc or .pdf and display a generic graphic with a link to the doc or pdf file.

Any help is appreciated.

I know in CF it would be an
 
What module(s) are you using in the actual Perl script? I'm not familiar with this templating style, but knowing this could help out quite a bit.

- Rieekan
 
Hi Rieeken,

Sorry this took so long, here's the associated template.
Code:
<html><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"  background= [URL unfurl="true"]http://216.92.102.167/green_bay/web_pages/images/bk0.gif>[/URL]
<Genesis:UserInput> 
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#C03CB8">
  <tr bgcolor="BC3AB4"> 
    <td height="36" width="78%" valign="top"><a href="[URL unfurl="true"]http://www.classzoom.com"><img[/URL] src="[URL unfurl="true"]http://216.92.102.167/images/heading2.gif"[/URL] width="247" height="34" border="0" align="absmiddle"></a> 
      <b>   <font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="4"> 
      <i>Your Classwork Page</i></font></b></td>
    <td height="36" width="22%">     <p> <font size="2" face="Arial, Helvetica, sans-serif"><b><a href="javascript:openpopup()"><font color="#FFFFFF">Click 
        here for text tips</font></a></b></font></p></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="10" background="[URL unfurl="true"]http://216.92.102.167/images/bk.gif">[/URL]
  <tr valign="top"> 
    <td height="650"> 
      <table width="90%" border="0" cellspacing="0" cellpadding="10" background="[URL unfurl="true"]http://www.classzoom.com/green_bay/web_pages/lmc/bk.gif"[/URL] align="center">
        <tr valign="top"> 
          <td height="665"> 
            <table width="583" border="0" cellspacing="0" cellpadding="0" align="center">
              <tr> 
                <td width="130" height="9"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399">School 
                  name: <br>
                  </font></td>
                <td width="166" height="9"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <input type="text" name="shared_school"/>
                  </font></td>
                <td width="19" height="9"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <br>
                  </font></td>
                <td width="124" height="9"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399">Class:</font></td>
                <td width="136" height="9"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <input type="text" name="shared_grade" size="20"/>
                  </font></td>
                <td width="8" height="9">&nbsp;</td>
              </tr>
              <tr> 
                <td width="130" height="11"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399">Teacher's 
                  name:</font></td>
                <td width="166" height="11"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <input type="text" name="shared_teacher"/>
                  </font></td>
                <td width="19" height="11"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399">&nbsp; 
                  </font></td>
                <td width="124" height="11"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399">School 
                  phone number:</font></td>
                <td width="136" height="11"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <input type="text" name="shared_phone_number"/>
                  </font></td>
                <td width="8" height="11">&nbsp;</td>
              </tr>
              <tr> 
                <td width="130" height="21"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399">Teacher's 
                  email address:</font></td>
                <td width="166" height="21"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <input type="text" name="shared_email_address"/>
                  </font></td>
                <td width="19" height="21">&nbsp;</td>
                <td width="124" height="21"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399">Teacher's 
                  voice mail: </font></td>
                <td width="136" height="21"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <input type="text" name="shared_voice_mail"/>
                  </font></td>
                <td width="8" height="21">&nbsp;</td>
              </tr>
              <tr> 
                <td width="130" height="2"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  Best hours to reach me:<br>
                  </font></td>
                <td width="166" height="2"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"> 
                  <input type="text" name="shared_best_hours"/>
                  </font></td>
                <td width="19" height="2">&nbsp;</td>
                <td width="124" height="2">&nbsp;</td>
                <td width="136" height="2"><font size="1" face="Arial, Helvetica, sans-serif" color="#003399"><br>
                  </font></td>
                <td width="8" height="2">&nbsp;</td>
              </tr>
            </table>
            <p> <font size="2" face="Arial, Helvetica, sans-serif" color="#003399">Heading 
              for your page: 
              <input type="text" name="heading"/>
              <font color="#990099" size="1"><b>*</b></font><b><font color="#990099">optional 
              </font></b></font> <br>
              <br>
              <font size="2" face="Arial, Helvetica, sans-serif" color="#990099"><b>Important: 
              </b></font><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Photos 
              must be in their original .jpg or .gif form.</font><br>
            <table width="100%" border="0" cellspacing="0" cellpadding="10">
              <tr> 
                <td height="137"> 
                  <table border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#CCCCFF" width="272" height="113">
                    <tr> 
                      <td height="91"> 
                        <table border="0" cellspacing="0" cellpadding="3" align="center" width="266">
                          <tr> 
                            <td height="84"> 
                              <input name="File01_filename" />
                              <font face="Arial, Helvetica, sans-serif" size="2" color="#000099">File 
                              name or URL</font><font face="Arial, Helvetica, sans-serif" size="1"> 
                              <br>
                              </font> 
                              <input type="file" name="File01" />
                              <br>
                              <font size="2" face="Arial, Helvetica, sans-serif" color="#000099">Upload 
                              new file </font></td>
                          </tr>
                          <tr> 
                            <td height="12"><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Caption 
                              1:</font> 
                              <input type="text" name="text1"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
                <td height="137"> 
                  <table border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#CCCCFF" width="273" height="104">
                    <tr> 
                      <td height="97"> 
                        <table border="0" cellspacing="0" cellpadding="3" align="center" width="264" height="116">
                          <tr> 
                            <td> 
                              <input name="File02_filename" />
                              <font face="Arial, Helvetica, sans-serif" size="2" color="#000099">File 
                              name or URL</font><font face="Arial, Helvetica, sans-serif" size="1"> 
                              <br>
                              </font> 
                              <input type="file" name="File02" />
                              <br>
                              <font size="2" face="Arial, Helvetica, sans-serif" color="#000099">Upload 
                              new file </font></td>
                          </tr>
                          <tr> 
                            <td height="12"><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Caption 
                              2:</font> 
                              <input type="text" name="text2"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td height="139"> 
                  <table border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#CCCCFF" width="272">
                    <tr> 
                      <td height="100"> 
                        <table border="0" cellspacing="0" cellpadding="3" align="center" width="266">
                          <tr> 
                            <td> 
                              <input name="File03_filename" />
                              <font face="Arial, Helvetica, sans-serif" size="2" color="#000099">File 
                              name or URL</font><font face="Arial, Helvetica, sans-serif" size="1"> 
                              <br>
                              </font> 
                              <input type="file" name="File03" />
                              <br>
                              <font size="2" face="Arial, Helvetica, sans-serif" color="#000099">Upload 
                              new file </font></td>
                          </tr>
                          <tr> 
                            <td height="12"><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Caption 
                              3:</font> 
                              <input type="text" name="text3"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
                <td height="139"> 
                  <table border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#CCCCFF" width="272">
                    <tr> 
                      <td height="116"> 
                        <table border="0" cellspacing="0" cellpadding="3" align="center" width="266">
                          <tr> 
                            <td> 
                              <input name="File04_filename" />
                              <font face="Arial, Helvetica, sans-serif" size="2" color="#000099">File 
                              name or URL</font><font face="Arial, Helvetica, sans-serif" size="1"> 
                              <br>
                              </font> 
                              <input type="file" name="File04" />
                              <br>
                              <font size="2" face="Arial, Helvetica, sans-serif" color="#000099">Upload 
                              new file </font></td>
                          </tr>
                          <tr> 
                            <td height="12"><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Caption 
                              4:</font> 
                              <input type="text" name="text4"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td height="133"> 
                  <table border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#CCCCFF" width="272">
                    <tr> 
                      <td height="106"> 
                        <table border="0" cellspacing="0" cellpadding="3" align="center" width="266">
                          <tr> 
                            <td> 
                              <input name="File05_filename" />
                              <font face="Arial, Helvetica, sans-serif" size="2" color="#000099">File 
                              name or URL</font><font face="Arial, Helvetica, sans-serif" size="1"> 
                              <br>
                              </font> 
                              <input type="file" name="File05" />
                              <br>
                              <font size="2" face="Arial, Helvetica, sans-serif" color="#000099">Upload 
                              new file </font></td>
                          </tr>
                          <tr> 
                            <td height="12"><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Caption 
                              5:</font> 
                              <input type="text" name="text5"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
                <td height="133"> 
                  <table border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#CCCCFF" width="272">
                    <tr> 
                      <td height="95"> 
                        <table border="0" cellspacing="0" cellpadding="3" align="center" width="266">
                          <tr> 
                            <td> 
                              <input name="File06_filename" />
                              <font face="Arial, Helvetica, sans-serif" size="2" color="#000099">File 
                              name or URL</font><font face="Arial, Helvetica, sans-serif" size="1"> 
                              <br>
                              </font> 
                              <input type="file" name="File06" />
                              <br>
                              <font size="2" face="Arial, Helvetica, sans-serif" color="#000099">Upload 
                              new file </font></td>
                          </tr>
                          <tr> 
                            <td height="12"><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Caption 
                              6:</font> 
                              <input type="text" name="text6"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <font size="2" face="Arial, Helvetica, sans-serif" color="#003399"><br>
            </font><font size="2" face="Arial, Helvetica, sans-serif" color="#990099"><b>Note: 
            </b></font><font color="#003399" face="Arial, Helvetica, sans-serif" size="2">Photos 
            may take time to upload. Refresh the browser if you don't see your 
            changes on the new page.</font> </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<tr> 
  <td> 
    <hr>
</Genesis:UserInput> <br>
<Genesis:File name="photos.html">
 <head> 
<title>%shared_school%, Green Bay Area Public Schools</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body text="#000000" link="#000099" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"  background="[URL unfurl="true"]http://www.greenbay.k12.wi.us/preble/images/bk5.gif"[/URL] border="0" cellspacing="0" cellpadding="0" align="center">
<tr> 
    
  <td height="36" rowspan="2" width="221"> 
    <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr> 
        <td rowspan="2" width="235" background="[URL unfurl="true"]http://www.classzoom.com/green_bay/web_pages/images/prebleftbl.gif">[/URL] 
          <div align="center"><a href="[URL unfurl="true"]http://www.greenbay.k12.wi.us/"><img[/URL] src="[URL unfurl="true"]http://www.greenbay.k12.wi.us/preble/images/preblogo.gif"[/URL] width="221" height="56" border="0"></a></div>
        </td>
        <td height="43" colspan="6"> 
          <center>
            <b><font face="Arial, Helvetica, sans-serif" size="4" color="#000000">%shared_school%</font></b> 
          </center>
        </td>
      </tr>
      <tr> 
        <td width="8" height="3" valign="top" background="[URL unfurl="true"]http://www.greenbay.k12.wi.us/preble/images/prebrtrnd10.gif"><img[/URL] src="[URL unfurl="true"]http://www.classzoom.com/green_bay/web_pages/images/prebrtrnd.gif"[/URL] width="8" height="29"></td><td width="97" height="3" bgcolor="#1C9047" valign="top"> <a href="index.html"><img src="[URL unfurl="true"]http://216.92.102.167/green_bay/web_pages/images/blblk.gif"[/URL] width="10" height="10" border="0"></a> 
          <a href="index.html"><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Class 
          Info</font></a></td>
        <td width="94" bgcolor="#1C9047" height="3" valign="top"><a href="homework.html"><img src="[URL unfurl="true"]http://216.92.102.167/green_bay/web_pages/images/yelblk.gif"[/URL] width="10" height="10" border="0"></a> 
          <a href="homework.html"> <font face="Arial, Helvetica, sans-serif" size="2" font="font" color="#FFFFFF">Homework</font></a></td>
        <td width="87" bgcolor="#1C9047" height="3" valign="top"><a href="photos.html"><img src="[URL unfurl="true"]http://216.92.102.167/green_bay/web_pages/images/ltblblk.gif"[/URL] width="10" height="10" border="0"></a> 
          <a href="photos.html"><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Class 
          Work</font></a></td>
        <td width="80" bgcolor="#1C9047" height="3" valign="top"><a href="photos.html"><img src="[URL unfurl="true"]http://216.92.102.167/green_bay/web_pages/images/redblk.gif"[/URL] width="10" height="10" border="0"></a> 
          <a href="links.html"><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Links</font></a> 
        </td>
        <td width="90" bgcolor="#1C9047" height="3" valign="top"><a href="photos.html"><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"> 
          </font></a><img src="[URL unfurl="true"]http://216.92.102.167/green_bay/web_pages/images/grnlblk.gif"[/URL] width="10" height="10" border="0"> 
          <font face=Arial, Helvetica, sans-serif size=2 color=FFFFFF> 
          <script>
/*
*/

//Specify monthly text and links.
var monthly_links=new Array(
"<font color=FFFFFF>Calendar</font>", "jan_cal.html",   //January
"<font color=FFFFFF>Calendar</font>", "feb_cal.html",   // Feburary 
"<font color=FFFFFF>Calendar</font>", "mar_cal.html",   // March 
"<font color=FFFFFF>Calendar</font>", "apr_cal.html",   // April 
"<font color=FFFFFF>Calendar</font>", "may_cal.html",   // May 
"<font color=FFFFFF>Calendar</font>", "june_cal.html",   // June 
"<font color=FFFFFF>Calendar</font>", "july_cal.html",   // July 
"<font color=FFFFFF>Calendar</font>", "aug_cal.html",   // August 
"<font color=FFFFFF>Calendar</font>", "sept_cal.html",   // September 
"<font color=FFFFFF>Calendar</font>", "oct_cal.html",   // October 
"<font color=FFFFFF>Calendar</font>", "nov_cal.html",   // November 
"<font color=FFFFFF>Calendar</font>", "dec_cal.html"   // December
)

var dateobj=new Date()
document.write('<a href="'+monthly_links[dateobj.getMonth()*2+1]+'">'+monthly_links[dateobj.getMonth()*2]+'</a>')
</script>
          </font> </td>
      </tr>
    </table>
    <table width="90%" border="0" cellspacing="0" cellpadding="12" bgcolor="#1C9047" align="center">
      <tr valign="top"> 
        <td height="234"> 
          <table width="100%" border="0" cellspacing="0" bgcolor="#FFFFFF" align="center" background="[URL unfurl="true"]http://www.greenbay.k12.wi.us/preble/images/bk6.gif"[/URL] cellpadding="6" height="217">
            <tr> 
              <td width="33%" valign="top" height="362"> 
                <div align="left"> <font face="Arial, Helvetica, sans-serif" color="#003366" font size="3"> 
                  <center>
                    <br>
                    <table width="183" border="0" cellspacing="0" cellpadding="0">
                      <tr> 
                        <td> 
                          <div align="left"><font face="Arial, Helvetica, sans-serif" color="#CC0000" size="3"><b><font color="#0000CC">%shared_teacher%</font></b></font> 
                          </div>
                        </td>
                      </tr>
                      <tr> 
                        <td> 
                          <div align="left"><font face="Arial, Helvetica, sans-serif" color="#CC0000" size="2"><b><font color="#0000CC">%shared_grade%</font></b></font> 
                          </div>
                        </td>
                      </tr>
                      <tr> 
                        <td height="8"> <font face="Arial, Helvetica, sans-serif" color="#003366" size="1"><b><font color="#000000">School 
                          phone:</font></b></font><br>
                          <font face="Arial, Helvetica, sans-serif" color="#CC0000" size="2"><b><font color="#0000CC">%shared_phone_number%</font> 
                          </b></font> </td>
                      </tr>
                      <tr> 
                        <td height="9"><font face="Arial, Helvetica, sans-serif" color="#003366" size="1"><b><font color="#000000">Voice 
                          mail:</font></b></font><br>
                          <font face="Arial, Helvetica, sans-serif" color="#CC0000" size="2"><b><font color="#0000CC">%shared_voice_mail%</font></b></font> 
                        </td>
                      </tr>
                      <tr> 
                        <td height="5"> <font face="Arial, Helvetica, sans-serif" size="1" color="#003366"><b><font color="#000000">Best 
                          hours to reach me:</font></b></font><br>
                          <font face="Arial, Helvetica, sans-serif" color="#CC0000" size="2"><b><font color="#0000cc">%shared_best_hours%</font></b></font> 
                        </td>
                      </tr>
                      <tr> 
                        <td height="7"><font face="Arial, Helvetica, sans-serif" size="1" color="#003366"><b><font color="#000000">E-mail:</font></b></font><br>
                          <a href="mailto:%shared_email_address%"><font face="Arial, Helvetica, sans-serif" size="2" color="#CC0000"><b><font color="#0000CC">%shared_email_address%</font></b></font></a> 
                        </td>
                      </tr>
                    </table>
                  </center>
                  </font></div>
              </td>
              <td width="67%" valign="top"> <font face="Arial, Helvetica, sans-serif" color="#003366" font size="4"> 
                <font face="Arial, Helvetica, sans-serif" color="#003366" font size="4"> 
                </font></font> 
                <table width="97%" border="0" cellspacing="0" cellpadding="0" align="center">
                  <tr> 
                    <td height="33"> 
                      <center>
                        <font color="#CC0033" face="Arial, Helvetica, sans-serif" size="4"><b><font color="#0000CC">%heading%</font><br>
                        </b></font> <font face="Arial, Helvetica, sans-serif" size="1" color="#000000">Click 
                        on image for a larger view.</font> 
                      </center>
                    </td>
                  </tr>
                </table>
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                  <tr valign="top"> 
                    <td width="50%"> 
                      <table width="195" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File01_filename %> <a href="%File01_filename%"> 
                            <img src="%File01_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File01_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text1%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                    <td height="54" width="50%"> 
                      <table width="193" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File02_filename %> <a href="%File02_filename%"> 
                            <img src="%File02_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File02_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text2%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr valign="top"> 
                    <td width="50%"> 
                      <table width="180" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File03_filename %> <a href="%File03_filename%"> 
                            <img src="%File03_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File03_filename %><% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text3%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                    <td width="50%"> 
                      <table width="180" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File04_filename %> <a href="%File04_filename%"> 
                            <img src="%File04_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File04_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text4%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr valign="top"> 
                    <td width="50%"> 
                      <table width="202" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File05_filename %> <a href="%File05_filename%"> 
                            <img src="%File05_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File05_filename %><% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text5%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                    <td width="50%"> 
                      <table width="199" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td height="252"> <% if File06_filename %> <a href="%File06_filename%"> 
                            <img src="%File06_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File06_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text6%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                </table>
                <font face="Arial, Helvetica, sans-serif" color="#003366" font size="4"><font face="Arial, Helvetica, sans-serif" color="#003366" font size="4"> 
                <p>&nbsp;</p>
                </font> </font></td>
            </tr>
          </table>
          <font size="1" face="Arial, Helvetica, sans-serif" color="#FFFFFF">    
          <script language="Javascript"><!--

var dateModified = document.lastModified;
mydate = dateModified.slice(0,10);

document.write("<b>Last updated: " + mydate + "</b>");

//-->/>
</script>
          </font> </td>
      </tr>
    </table>
  </td>
    </tr><center>
  <br>
  <font size="1" face="Arial, Helvetica, sans-serif" color="0078C0"><u><a href="[URL unfurl="true"]http://www.classzoom.com"><font[/URL] color="#000099">Class 
  Zoom</font></a></u></font><font size="1" color="#999999" face="Arial, Helvetica, sans-serif"> 
  <font color="#666666">self-maintainable web pages</font></font> 
</center></body>
</html>
</Genesis:File>
 
and the rest:
Code:
<img src="%File01_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File01_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text1%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                    <td height="54" width="50%"> 
                      <table width="193" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File02_filename %> <a href="%File02_filename%"> 
                            <img src="%File02_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File02_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text2%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr valign="top"> 
                    <td width="50%"> 
                      <table width="180" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File03_filename %> <a href="%File03_filename%"> 
                            <img src="%File03_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File03_filename %><% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text3%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                    <td width="50%"> 
                      <table width="180" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File04_filename %> <a href="%File04_filename%"> 
                            <img src="%File04_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File04_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text4%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr valign="top"> 
                    <td width="50%"> 
                      <table width="202" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td> <% if File05_filename %> <a href="%File05_filename%"> 
                            <img src="%File05_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File05_filename %><% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text5%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                    <td width="50%"> 
                      <table width="199" border="0" cellspacing="0" cellpadding="10" align="center">
                        <tr valign="top"> 
                          <td height="252"> <% if File06_filename %> <a href="%File06_filename%"> 
                            <img src="%File06_filename%" border=0 width=180 /></a> 
                            <% end if %> <% if not File06_filename %> <% end if %> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
                              <tr> 
                                <td><font size="1" face="Arial, Helvetica, sans-serif">%text6%</font></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                </table>
                <font face="Arial, Helvetica, sans-serif" color="#003366" font size="4"><font face="Arial, Helvetica, sans-serif" color="#003366" font size="4"> 
                <p>&nbsp;</p>
                </font> </font></td>
            </tr>
          </table>
          <font size="1" face="Arial, Helvetica, sans-serif" color="#FFFFFF">    
          <script language="Javascript"><!--

var dateModified = document.lastModified;
mydate = dateModified.slice(0,10);

document.write("<b>Last updated: " + mydate + "</b>");

//-->/>
</script>
          </font> </td>
      </tr>
    </table>
  </td>
    </tr><center>
  <br>
  <font size="1" face="Arial, Helvetica, sans-serif" color="0078C0"><u><a href="[URL unfurl="true"]http://www.classzoom.com"><font[/URL] color="#000099">Class 
  Zoom</font></a></u></font><font size="1" color="#999999" face="Arial, Helvetica, sans-serif"> 
  <font color="#666666">self-maintainable web pages</font></font> 
</center></body>
</html>
</Genesis:File>
 
It sounds like she is trying to modify, with permission, an opensource product called classzoom.
 
That looks to be the template itself, not the module used to parse that template.

Also, since this is an open source development project, I would suggest working with the developer(s) where they store the versions of their project.

- Rieekan
 
She had tried to work with the developer, he no longer wants to support the product I guess.

I really only need to know how to parse a file extension in cgi. How do I check for .pdf or .doc?

Thanks
 
The information you posted is the template that is parsed, not the code, so I couldn't say what to do to fix this.

- Rieekan
 
Code:
foreach (@files) {
 ($name, $ext) = split /\./, $_;
 if (lc($ext) eg ".pdf") {
   print "It's a PDF\n";
 } elsif (lc($ext) eq ".doc") {
   print "It's a document file"
 ...
}

You could also do it using substr, and pass -3 to get the last 3 characters, don't have time to look up the syntax just now though

--Paul

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top