Link to home
Start Free TrialLog in
Avatar of scottspivey
scottspivey

asked on

Deep Link into HTML page

I need to find a way to link to a specific part of an html page.  I subscribe to a service that provides HTML docs to my company.  When I pull up the HTML page there can be one or multiple documents all on the same HTML page.  For example, one HTML page that I just looked at had 12 separate documents within that one HTML page.  What I want to do is come up with a way that I can have a hyperlink open the HTML page to the specific part of the page that each document begins at.  For example, the HTML page that I just looked at has these documents:

AIM Basic Value Fund
AIM Conservative Allocation Fund
AIM Global Equity Fund

I want to create a hyperlink for each of the three documents above, but when I click on the hyperlink for AIM Basic Value Fund I want the HTML page to open directly to the first page of the AIM Basic Value Fund document.  When I click on the link for the AIM Conservative Allocation Fund I want the HTML page to open directly to the first page of the AIM Conservatie Allocation Fund document.  I want the same thing for the AIM Global Equity Fund and for the other 8 documents that are part of this HTML page.

I don't have any control over that HTML page that is created and provided to me.  Is there any way to do what I want?  Or is it impossible?
Avatar of InteractiveMind
InteractiveMind
Flag of United Kingdom of Great Britain and Northern Ireland image

If I understand you correctly...


Right before the header for each document, add something like this:

  <a name="DocReference"></a>

Then, to jump to this part in the web page, you create a link like this:

  <a href="#DocReference">Jump to some part of this page</a>


Obviously, you need to change the value from 'DocReference' to a relevent title which must be different for each header.


Is that clear?
Avatar of scottspivey
scottspivey

ASKER

InteractiveMind,

that is clear and would work if i had any control over the source code for the pages that i am accessing.  here is part of the code for one of the pages that i need to go directly to:


YOUR GOALS. OUR SOLUTIONS.   [AIM INVESTMENTS LOGO APPEARS HERE]
<BR>
--Registered Trademark--          --Registered Trademark--
</SPAN>
</P>
<HR CLASS="eolPageBreak">
<A NAME="eolPage34"></A>
<P CLASS="eolCenter eolNewPage">
<SPAN STYLE="font-weight: bold">
AIM CONSERVATIVE ALLOCATION FUND
<BR>
PROSPECTUS
<BR>
</SPAN>
APRIL 24, 2006
</P>
<P>
AIM Conservative Allocation Fund seeks total return consistent with a lower
level of risk relative to the broad stock market.


the only thing i know about this page, without viewing the source code, is the name of the fund is AIM Conservative Allocation Fund.  is there anyway to link to that name without having an anchor at that spot?
the anchor "eolPage34" doesn't do me any good because i don't know what it is without looking at the code.
That's not the first time I've overlooked parts of a question and posted a useless comment today.
Am really sorry.


I will give it a proper read, and see what I can come up with.
that is fine.  thanks for trying to help.
is modifying the HTMLs with a script an option?
scottspivey, does your server support PHP?
yotamsher,

possibly.  i would have to look at the company i get the html from to be sure we aren't infringing on anything.
InteractiveMind,

i don't currently run PHP.  i will have to get with my developers to see if the server supports it.  is there somthing i can look at to know?  i run windows server 2003 standard if that tells you anything.
in case you can modify the htmls, you will be able to add anchors in the places you wish to point, and then offcourse you can point it with the # in the URL
InteractiveMind,

i just verified that my server does support PHP and they DLL is already installed.
yotamsher,

that will work as long as i have access to modify the html.  even if i can just add an anchor that would allow me to do what i need.
Okay, that's good -- perhaps we can create a PHP solution.

Keeping in mind that I despise web development, I shall try and get something working for you. ;-P


By the way, do you know off your head which version of PHP is installed?
If not, then not to worry..
no idea, but i will find out.  i need to know anyway.
ASKER CERTIFIED SOLUTION
Avatar of InteractiveMind
InteractiveMind
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
InteractiveMind,

i don't know anything about PHP so you will have to walk me through the setup and use.
Okay, no probs...


- Open a text editor (such as Notepad), and copy and paste the above code into it;

- Save this file somewhere convenient (such as your desktop) with an appropriate filename, but it must
  end with a .php extension ("DeepLink.php" for example);

- Now you need to move/upload this PHP file onto your web server... are you able to do this?


Once the PHP file is on the web server, it's ready for use.

So if for example, you saved the file as "DeepLink.php" into the root of your web server, then you can access it in your browser with the following URL:

http://yourWebServersName/DeepLink.php



If it all works okay, then there will be a text field, and a submit button next to it.

Simply copy/paste the URL of one of the HTML pages into that text field, and hit the submit button... and it will hopefully do what you require.


[This PHP code can of course be customized so that you can interact with it differently. But let's see if this works fine first..]
ok that makes sense.  i am going to test this over the weekend and see how it works.  one prob though, i was trying to find out my version of PHP and the solution I found does not work.  I found a post to write a php file:

<?
        phpinfo();
?>

i saved that file into my http folder where all my other code is at and when i try to run it i get a page cannot be found error.  my hosting company tells me PHP is installed.  do i need to activate it or set it to run as a service?
Well,

<?php
        phpinfo();
?>

is generally more compatible.


But if you're getting a "page cannot be found" error, then it would seem to be independent of your PHP setup.

Are you sure that you're typing the correct filename?

Also, be careful that when you saved your PHP file with it's .php extension, that your text editor didn't append a .txt or anything to it... So, filename.php.txt is NOT what you want; it must be filename.php..



(BTW, typically when 'they' say "PHP is installed", that means it's all setup and ready to go)
that is what i thought.  i am double checking now to be sure i have spelled everything correctly.  i will rewrite the php like you suggest and see what happens.  if that still doesn't work i will give a call to support and see what is going on.  i will post back as soon as i find out something.
still couldn't get the test.php file to work.  i have tech support working on this now and my wife is telling me that i am taking her out to eat dinner, so i may have to drop this for now and pick it back up over the weekend.

alas my tech support is now telling me that php is not installed.  i love it when i get two answers to the same question.

i will have to install that over the weekend.  is there a specific source that i need to get the php from?  and is there a particular that i need to get?

i will get everything and install it over the weekend so i can run your script and see what happens.

thx.
hahaha that's a pain.


To install PHP:

You can get the official installation from here:
http://www.php.net/downloads.php

But configuring PHP can be a bit of a pain, so I personally use WAMP:
http://www.wampserver.com/en/

WAMP basically installs and configures PHP (and if you want, MySQL etc) all for you.
It couldn't be easier (wellll....).

Once installed, I imagine that you will need to reboot your Windows Server for it to work; is this possible?


Well, have fun.

I'm in the GMT timezone, so will be disappearing for several hours soon-ish.

However, I will be on most of this weekend, so will help you then if necessary..
does Perl have anything to do with PHP?
Well, sort of....

- PHP and Perl are both Programming languages;
- PHP is a web-based [server side] language; and Perl can (and quite often is) also used for similar purposes;
- The Perl language had quite an influence on the PHP language (such as syntax etc);
- Perl and PHP (among others) can be integrated together fairly easily;

But they're both independent.
ok thx.  i will get php running and let you know how the script works out.  i have sent a copy to my developers also so they can look at it.  if the basic idea works they should be able to customize it to our specific needs.
No probs.
Have a good night.
InteractiveMind,

sorry it has taken me so long to get back to you.  i did not have much time to spend with this over the weekend but i did pass it on to my developers and they are going to be able to use what you started and customize it to our specific needs.  thx for the help, you have saved me a ton of time.

scott
You're welcome  :-)

If any queries to pop out however, feel free to ask..