I really need some help with this one. I am confident it can be done easily, but i can not figure it out.
A very simplified look at my "announcements_current.php" page follows:
<div class=”main_nav”>
<a href=”about.php”>About</a>
<a href=”contact.php”>Contact</a>
<a href=”resources.php”>Resources</a>
</div>
<div class=”announcement”>
/* Announcement 1 */
<p>For more information on this subject <a href=”/file_path/file0001.doc”>click here</a>.</p>
</div>
<div class=”announcement”>
/* Announcement 2 */
<p>For more information on this subject <a href=”/file_path/file0002.doc”>click here</a>.</p>
</div>
As the above page (announcements_current.php) loads it reads the mySQL database for current announcements, loops through each record and displays the page. I would like to have all hyperlinks within the <div class="announcements"> rewritten on load to be <a href="file_open.php?aFile=/file_path/file0001.php"> (of course whatever the file name actually is).
My file_open.php updates a database table with the date/time/user_id of when this file was accessed, then opens the file.
Of course I do not want to rewrite any other hyperlinks not in the correct class. I am sure this can be done, but i can not fire out how to accomplish this onload. Can you help?