Results 1 to 5 of 5

Thread: Extracting Tabbed Document Viewer URL for use with PHP

  1. #1
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Extracting Tabbed Document Viewer URL for use with PHP

    Hi, I'm trying to build an easier way to browse the content of PubMed/MEDLINE. I'd like to somehow extract the URL being displayed in the Tabbed Document Viewer (http://www.dynamicdrive.com/dynamici...bdocviewer.htm) so that it can be manipulated with a PHP script. The initial URL in the Tabbed Document Viewer would be http://www.nlm.nih.gov/mesh/2006/MeSHtree.html and users could then click on a Medical Subject Heading. When a subject heading is clicked on, the PHP script would output recent citations for the heading underneath the Tabbed Document Viewer. I'm sure that there's a simple way to do this, so I'd appreciate your help.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's in the "selectedtablink" Javascript variable.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I need to know how to convert the selectedtablink variable into a variable that I can use with PHP.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Now there's a tricky one. To send it server-side, you'll need to submit a form with an element the value of which has been set to selectedtablink. This is a bit inelegant. You could also use AJAX:
    Code:
    function getHTTPObject() {
      var httpobject = null;
      try {
        httpobject = new XMLHttpObject();
      } catch (e) {
        try {
          httpobject = new ActiveXObject("Msxml2.DOMDocument");
        } catch (e) {
          try {
            httpobject = new ActiveXObject("Msxml.DOMDocument");
          } catch (e) { }
        }
      }
      if(typeof httpobject.load == "undefined") httpobject = null;
      return httpobject;
    }
    
    function touchPage(page) {
      var xho = getHTTPObject();
      if(xho == null) return;
      xho.open("GET", page, true);
      xho.send(null);
    }
    Then, add
    Code:
    touchPage("mypage.php?url=" + selectedtablink);
    to the bottom of the handlelink() function (but before return false;). This will call a PHP page, from which you can then grab the "url" GET parameter and use it in whatever odd rituals you may wish to.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the suggestion. That route turned out to be much too difficult to bother with, so I used a combination of two iFrames instead (based on the suggestions at http://www.samisite.com/test-csb2nf/id82.htm).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •