| |||||||||||
| |||||||||||
More details link to reveal a data column Posted by abdul (abdul), 21 March 2006 Hi, I wander if anyone can help please:I am trying to link to a sub routine which will print another field of data from the flat file related to the record. open (FILE,"../../etl/data/register.txt"); while ($mfile=<FILE>){ if($mfile=~/$plats/){ @bank=split/\t/,$mfile; $search++; #$namn=@bank[0]; $position=@bank[1]; $description=@bank[2]; $datpost=@bank[3]; $jobref=@bank[4]; $details=@bank[5]; print "<tr> <td width='70' valign='top'><b>Position:</b></td> <td><font size='3'>$position </font></td> </tr> <tr> <td width='45' valign='top'><b>Description:</b></td> <td valign='middle'><font size='2'>$description </font></td> <td width='150' align='center' valign='middle'><font size='2'>» <********a href='more_details();*******'>View more details </a></font></td> </tr>"; **********sub more_details { print "<tr> <td width='70' valign='top'><b>More details:</b></td> <td><font size='3'>$details </font></td> </tr>"; }*********** I have searched everywhere but cannot find out how I could possibly use the href tag to link to a sub routine. Could you help please? I have marked the areas of attention with **** to help identify the areas in questions. I would appreciate any help. Thank you. Posted by admin (Graham Ellis), 21 March 2006 Abdul ... I'm teaching a different language and also on the road at the moment ... my head just didn't click into gear when I looked. I'll be back in 24 hours or so on this one.Posted by admin (Graham Ellis), 22 March 2006 Abdul, I thing the immediate answer is that you need your code to read something like .........< a href=" .more_details(). "> more details .... and have the more_details subroutine use the return statement to pass back a URL that you want to link to. If you want to re-run the same page but have the more_details subroutine provide extra text in the new page, then you'll need to add something onto the URL (perhaps a parameter such as ?details=1 ) which you can check for in the subsequent page, and so provide the extra information requested. This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |