in reply to Re: Q & A
in thread Q & A
You can cycle through each question like this:%q_and_a = ( '105' => 'How do I use Netscape', '111' => 'How do I listen to MP3s', '119' => 'How can I send email with attachments' );
This is a simple hash, and the keys are the unique identifiers for each question in the database. So when someone clicks on the link, your script would capture the id number and then pull out the answer and display it.foreach (keys(%q_and_a)) { print "Q: <a href=answers.cgi?q=$_>$q_and_a{$_}</a>\n"; }
Q: <a href=answers.cgi?q=119>How can I send email with attachments</a> Q: <a href=answers.cgi?q=111>How do I listen to MP3s</a> Q: <a href=answers.cgi?q=105>How do I use Netscape</a>
|
|---|