Hunter-X- has asked for the wisdom of the Perl Monks concerning the following question:
Im makinga small catalogue as a project for college, my teachers are thick so I thought Id ask "the monks" as you seem to know ur stuff :)
I have 10 products each with codes and a picture ive got all the info ordered in arrays with selection being via a link with some value's on it.
But is there away to have pictures in an array? ive tried some bizzar methods but all failed :( here's my script if it helps?>>
#!/usr/bin/perl -wT use strict; use CGI ':standard'; # dita.cgi my ($brand, $item, $prod, @code, @price, @name, @disc); $brand= param('brand'); $item= param('item'); $prod= param('prod'); @code=('HSDIT001','HSDIT002','HSDIT003','HSDIT004','HSDIT005','HSDIT00 +6','HSDIT007','HSDIT008','HSDIT009'); @price=('£68.00','£85.00','£80.75','£72.00','£68.00','£59.50','£51.00' +,'£39.00','£25.50'); @name=('Gega Comp 5','Gega Pro Max Comp','Mega Pro J','Mega Sting J',' +Mega Sonic J','Mega Fusion J','Mega Tech','XTS 750 J','XTS 550'); @disc=('Full composite, Mega J head, Carbon fibre & Glass fibre.','Ful +l composite, J head shape.','Aramid, Carbon, Glass Fibre reinforced, J Lignostone head.','Aramid, Carbon, Glass Fibre reinforced, J Mulberry head.','Aramid, Carbon, Glass Fibre reinforced, J Lignostone head.','A +ramid, Glass Fibre reinforced, Midi head.','Laminated J head, Aramid, Glass F +ibre reinforced.','Laminated Midi head, Glass fibre reinforced.'); print "Content-type: text/html\n\n"; print '<html><head></head><body bgcolor="#C0C0C0"> <div align="center"> <center> <table border="0" width="600" cellspacing="0" cellpadding="0" height +="500"> <tr> <td width="100%" align="center"> <div align="center"> <table border="0" cellspacing="0" cellpadding="0" width="600 +"> <tr> <td width="10" align="center"></td> <td width="270" align="center"></td> <td width="40" align="center"></td> <td width="270" align="center"></td> <td width="10" align="center"></td> </tr> <tr> <td width="10" align="center"></td> <td width="580" align="center" colspan="3"> <table border="0" width="100%" bordercolor="#000080" c +ellspacing="0" cellpadding="0" height="20"> <tr> <td width="100%" height="10" align="center"> <div align="center"> <table border="0" width="100%" bgcolor="#00008 +0" cellspacing="0" cellpadding="0"> <tr> <td width="33%" align="right">'; print qq (<font color="#FFFFFF"><font face="Tahoma" size="1"><b>$brand +<<</b></font>); print '</td> <td width="33%" align="center">'; print qq (<font color="#FFFFFF"><font face="Tahoma" size="1"><b>$item< +/b></font>); print '</td> <td width="34%" align="left">'; print qq (<font color="#FFFFFF"><font face="Tahoma" size="1"><b>>>$nam +e[$prod]</b></font>); print '</td> </tr> </table> </div> </td> </tr> <tr> <td width="100%" height="10" align="center"> <table border="1" width="100%" bordercolor="#000 +080" cellspacing="0" cellpadding="0"> <tr> <td width="20%" align="center" bgcolor="#FFF +FFF"><font color="#000088"><font face="Tahoma" size="1">Cost:</font>< +/td> <td width="20%" align="center" bgcolor="#FFF +FFF">'; print qq (<font color="#000088"><font face="Tahoma" size="1">$price[$p +rod]</font>); print '</td> <td width="20%" align="center" bgcolor="#000 +080"><font color="#FFFFFF"><font face="Tahoma" size="1"><b>Buy Now</b +></font></td> <td width="20%" align="center" bgcolor="#FFF +FFF"><font color="#000088"><font face="Tahoma" size="1">Product Code: +</font></td> <td width="20%" align="center" bgcolor="#FFF +FFF">'; print qq (<font color="#000088"><font face="Tahoma" size="1">$code[$pr +od]</font>); print '</td> </tr> </table> </td> </tr> </table> </td> <td width="10" align="center"></td> </tr> <tr> <td width="10" align="center" height="20"></td> <td width="270" align="center" height="20"></td> <td width="40" align="center" height="20"></td> <td width="270" align="center" height="20"></td> <td width="10" align="center" height="20"></td> </tr> <tr> <td width="10" align="center"></td> <td width="270" align="center"> <table border="1" width="100%" bordercolor="#000080" c +ellspacing="0" cellpadding="0" height="120"> <tr> <td width="100%" height="10" bgcolor="#000080" ali +gn="center">'; print qq (<font color="#FFFFFF"><font face="Tahoma" size="1">Product I +mage: $name[$prod]</font>); print '</td> </tr> <tr> <td width="100%" height="110" align="center" bgcol +or="#FFFFFF"><font color="#000088"><font face="Tahoma" size="1">Not A +vailable</font></td> </tr> </table> </td> <td width="40" align="center"></td> <td width="270" align="center"> <table border="1" width="100%" height="120" bordercolo +r="#000080" cellspacing="0" cellpadding="0"> <tr> <td width="100%" height="10" bgcolor="#000080" ali +gn="center">'; print qq (<font color="#FFFFFF"><font face="Tahoma" size="1">Product D +iscription: $name[$prod]</font>); print '</td> </tr> <tr> <td width="100%" height="110" align="center" bgcol +or="#FFFFFF">'; print qq (<font color="#000088"><font face="Tahoma" size="1">$disc[$pr +od]</font>); print '</td> </tr> </table> </td> <td width="10" align="center"></td> </tr> <tr> <td width="10" align="center" height="20"></td> <td width="270" align="center" height="20"></td> <td width="40" align="center" height="20"></td> <td width="270" align="center" height="20"></td> <td width="10" align="center" height="20"></td> </tr> <tr> <td width="10" align="center"></td> <td width="580" align="center" colspan="3"> <table border="0" width="100%" bordercolor="#000080" c +ellspacing="0" cellpadding="0"> <tr> <td width="100%" height="10" align="center"> <div align="center"> <table border="0" width="100%" bgcolor="#00008 +0" cellspacing="0" cellpadding="0"> <tr> <td width="33%" align="right"><font color= +"#FFFFFF"><font face="Tahoma" size="1"><<</td> <td width="33%" align="center"><font color +="#FFFFFF"><font face="Tahoma" size="1"><b>Relavent Links</b></font>< +/td> <td width="34%" align="left"><font color=" +#FFFFFF"><font face="Tahoma" size="1">>></td> </tr> </table> </div> </td> </tr> <tr> <td width="100%" height="10" align="center"> <div align="center"> <table border="1" width="100%" bordercolor="#0 +00080" cellspacing="0" cellpadding="0" height="10"> <tr> <td width="20%" align="center" bgcolor="#F +FFFFF"><font color="#000088"><font face="Tahoma" size="1"><b>Stick Ba +gs</b></font></td> <td width="20%" align="center" bgcolor="#F +FFFFF"><font color="#000088"><font face="Tahoma" size="1"><b>Hockey B +alls</b></font></td> <td width="20%" align="center" bgcolor="#0 +00080"><font color="#FFFFFF"><font face="Tahoma" size="1"><b>Back</b> +</font></td> <td width="20%" align="center" bgcolor="#F +FFFFF"><font color="#000088"><font face="Tahoma" size="1"><b>Grips</b +></font></td> <td width="20%" align="center" bgcolor="#F +FFFFF"><font color="#000088"><font face="Tahoma" size="1"><b>Stick Re +pair</b></font></td> </tr> </table> </div> </td> </tr> </table> </td> <td width="10" align="center"></td> </tr> <tr> <td width="10" align="center"></td> <td width="270" align="center"></td> <td width="40" align="center"></td> <td width="270" align="center"></td> <td width="10" align="center"></td> </tr> </table> </div> </td> </tr> </table> </center> </div></body></html>';
I know its abd but ive only been doing this a couple of weeks :( help plz ?
Edit - Petruchio Fri Mar 22 13:04:03 UTC 2002: Added markup
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do you change the picture displayed?
by knobunc (Pilgrim) on Mar 22, 2002 at 15:05 UTC |