On my website, I have an Article Viewer page where users are allowed to search through and select articles to view. These articles are viewed in an Iframe. When an article is selected, I simply change the Iframe's src. Currently, there is no way to establish a direct link to a specific article.
For example, if I were to copy the URL of the page and view it on a different computer, the Article that was being viewed would not show. Instead, it would show the page with an empty Iframe. Is there a way that I can create unique URLs for these articles so that if I were to copy the URL, the same article will be displayed elsewhere?
This is my html code:
<input id="article-search-textbox" class="textbox" type="text" placeholder="Article Search"></input>
<iframe id="document-viewer" src=""></iframe>
Javascript code using Jquery UI Autocomplete (http://api.jqueryui.com/autocomplete/):
$(document).ready(function(){
$(function(){
$("#article-search-textbox").autocomplete({
source: "/functions/article_search.php",
delay: 800,
select: function(event, ui){
$("#document-viewer").attr("src", "/articles/" + ui.item.value + ".pdf");
}
});
});
});
article_search.php accesses the database and returns all results that match the search string.