Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Links on multiple pages

  1. #1
    Join Date
    Jun 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Links on multiple pages

    I have a series of pages each containg a link to a web-based database. That database recently changed the way they look up information and my links are no longer valid. I now have to go back and change about 200 pages.
    My question is for the future... Is there a way to "pull" a hyperlink's target from another file so that I only have to change the one file from now on each time the online database changes?

    Does that even make sense?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are a number of ways depending upon what is available to you. You could have your links go to a page that has a meta refresh tag on it:
    HTML Code:
    <META HTTP-EQUIV = "REFRESH" CONTENT = "0; URL=http://www.some.com/somepage.html">
    This would go in the head of the document. This does not work 100% but is pretty reliable. With meta refresh it is a good idea to provide a conventional link on the page as well, should someone otherwise get stuck there. You can use a script but, unless the page you are sending them to requires javascript, I'd recommend against that, as folks without javascript would be lost. A server side include would probably be best. Mike will probably chime in here and explain how that can work. It does depend upon your having a host that allows that. 200 pages is not too many for an editor like Edit Pad Pro which can load multiple files and make global changes to them. There are also stream and/or line editors that can do this from the command line. My favorite is gledit but, it takes some getting used to.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay, here is what I mean...

    what used to be
    <a href="http://db.tinkersgardens.com/searchcc.asp?PARENTAGE=ALEXANDRA" target="_blank">Search Tinker's</a>

    is now
    <a href="http://db.tinkersgardens.com/?script=3.6&PARENTAGE=ALEXANDRA" target="_blank">Search Tinker's</a>

    As I have over 5,000 pages each referencing a different cultivar, it is a long process to go and change each of them each time the site owner changes his code to look up a cultivar.

    I was wondering if there was a way to change my linkage to be something like
    look up the link base (found in file "link.txt" or similar) add "ALEXANDRA" then go there.
    <a href="part 1" + "ALEXANDRA" target="_blank">Search Tinker's</a>

    That way I only have to change "link.txt" each time.

    just hoping there's a way.
    Tommie

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not using just HTML (the name of the forum you've posted in) except using the meta refresh method which would work like this:

    The link on the 5,000 pages would look something like this:
    HTML Code:
    <a href="redirect.htm" target="_blank">Search Tinker's</a>
    Then redirect.htm would look something like this:
    HTML Code:
    <html>
    <head>
    <title>Search Tinker's - Redirect</title>
    <META HTTP-EQUIV = "REFRESH" CONTENT = "0; URL=http://db.tinkersgardens.com/?script=3.6&PARENTAGE=ALEXANDRA">
    </head>
    <body>
    If you are seeing this, something went wrong.<br>
    Click <a href="http://db.tinkersgardens.com/?script=3.6&PARENTAGE=ALEXANDRA">here</a> to search Tinker's.
    </body>
    </html>
    Now, as I said before, a server side redirect would be better but, that is outside my area of expertise except to say that your host must allow you to do it and the method varies from one host to another. Other methods could be employed as well, none of them are strict HTML. A javascript method could be to use this for your 5,000 links:
    HTML Code:
    <script src="searchTinker.js" type="text/javascript"></script><noscript>JavaScript required to Search Tinker's</noscript>
    Then the file searchTinker.js could look like this:
    Code:
    document.write('<a href="http://db.tinkersgardens.com/?script=3.6&PARENTAGE=ALEXANDRA" target="_blank">Search Tinker's</a>')
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Post

    I recommend Kate for a good editor, which is only emphasised by the fact that I'm usually anti-KDE.
    If you were to use a PHP script, it would be much easier. All following examples are in PHP, and won't work unless you have PHP installed on your webserver.
    PHP Code:
    <?php $url urlencode(implode(file('link.txt'), "")); ?>
    <a href="<?=$url?>" target="_blank">Link text</a>
    Then edit link.txt in the same directory as the script. No redirection required. You could also use a database, but I can't give you appropriate code for your webserver without knowing the database software you have.
    If you'd prefer to use a redirect, simply replace the file with:
    PHP Code:
    <?php header("Location: /path/to/newpage.php"); ?>
    If you're using a CGI script, rather than outputting "Content-Type: text/html", declare "Location: /path/to/newpage.php".
    Note that redirects of any type aren't infallible, although 95% of modern browsers accept them fine. Sometimes a user will disable them.
    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!

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    If you were to use a PHP script, it would be much easier . . .
    This is one of the other methods I was alluding to. If it were truly easier though, it wouldn't require the cooperation of one's host. Absent that, I'd say the difficulty level is roughly equivalent. It interests me that you, Twey, mention Kate and KDE. I've got both but, would never use either for mission critical work or anything I didn't want to make into a potential adventure, only because they are so prone to crashing, otherwise they are very nice programs, probably much easier to install (and I'd hope much more stable) on other platforms than Windows (what I and most folks use). What OS('s) do you run?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Arrow

    Sorry, let me rephrase that: were PHP already installed and set up, it would be a lot simpler and more reliable to use it to achieve the effect required.

    As mentioned above, I'm usually against KDE, for its slowness.
    I never noticed a lack of reliability, must just be a Windows thing; perhaps it's also slower on Windows. On Linux it's been officially benchmarked as running at about Windows XP speed, which is still rather slow compared to something like GNOME, which runs (observation only, no benchmarks) roughly twice as fast.
    However, I happen to love Kate, perhaps just as a matter of personal taste. Of course, it doesn't beat a good IDE for coding projects, but for a small app or script (or something in a simple syntax, for example, HTML), it's my GUI editor of choice.
    I run FC4 on this machine; I also have a small server (currently down due to lack of a spare ethernet cable) that was running Debian Woody, but I'm thinking of switching it to OpenBSD. I'm not unfamiliar with Windows, however; I only switched to Linux a couple of years ago.
    Are you using Cygwin?
    Last edited by Twey; 06-20-2005 at 09:58 AM. Reason: Typo
    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!

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yeah, Cygwin. It was an [expletive deleted] to install as the support and available files I found were minimal (this is only for a windows install that I am talking about). I finally had to steal a dll from another package (scribus) to get it all to work. Kate reminds me of my favorite Windows based editor, Edit Pad Pro but, seems more full featured and at the price (free for Kate) a real bargain. Anyways, I originally wanted Cygwin so I could have a look at Konqueror. Unfortunately, the version with Cygwin seems really buggy. Could be due to a lack of all the proper support files. Fonts seem limited and many jpeg files are not rendered even though you can get a look at them with Kview. I thought it was a configuration thing but some jpegs come up fine. One of these days I think I'll just archive the whole thing, uninstall it and try reinstalling. With what I learned the first time through I probably can do a better job the second time round.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Post

    Yes, people say that since the software is free, it must not be as good as the more expensive closed-source software, which simply isn't true. Contrary to the reasoning behind pricing Windows Server 2003 Enterprise at $3,999 and the strict Microsoft licensing system, people can and do make good, professional-quality software for little or no money.
    Konqueror's not that good, however. The folks at KDE have tried to combine too many programs into one. Remind you of anyone? I doubt if many people use it as a serious web browser, and if they do, they shouldn't.
    If you seriously want to test another OS or a *nix browser, with absolutely no risk of damage to your existing setup, I recommend a liveCD. I tried one myself a little while back, and I was very impressed: it's actually a fully-featured desktop, all packed onto one CD.
    Last edited by Twey; 06-20-2005 at 10:07 AM.
    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!

  10. #10
    Join Date
    Jun 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks guys....

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
  •