Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
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/){
print "<tr>
   <td width='70' valign='top'><b>Position:</b></td>
   <td><font size='3'>$position </font></td>
   <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'>&raquo; <********a href='more_details();*******'>View more details </a></font></td>
**********sub more_details {
  print "<tr>
   <td width='70' valign='top'><b>More details:</b></td>
   <td><font size='3'>$details </font></td>

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 and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho