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:
/* Announcement 1 */
<p>For more information on this subject <a href=”/file_path/file0001.doc”>click here</a>.</p>
/* Announcement 2 */
<p>For more information on this subject <a href=”/file_path/file0002.doc”>click here</a>.</p>
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?
Edited by jostclan, 09 September 2013 - 04:09 PM.