Forum Moderators: coopster
I have a quick question, should not be hard.
So Basically I am trying to figure out how can I create a link that will change the value of <>include<>.
I am trying to create alphabetized link directory, it just basically displays the whole alphabet on the page. Each letter on the page should be linked to a text file, that will have links with descriptions, now I came up with something like this below.
here is a little code
......
<td class="border" align="center"><a href="w.txt">W</a></td>
<td class="border" align="center"><a href="x.txt">X</a></td>
<td class="border" align="center"><a href="y.txt">Y</a></td>
<td class="border" align="center"><a href="z.txt">Z</a></td>
</tr>
</table>
<p align="center">
<?php include ("data.txt");?> //This is initial value.
I my explanations are now understandable please let me know.
Or maybe you can offer me another way.
Here are some images.
I hope to get the answer soon.
Thank you,
-Fast4u
[edited by: jatar_k at 8:21 pm (utc) on April 3, 2007]
[edit reason] no urls thanks [/edit]
if I wanted to do it with php I would change each txt file into a php file and then include my menus and whatever else I need
then have real links to those pages in my top menu
you could load them all and use layers/divs to switch them, not sure if that may be a lot of overhead for a single page though
1) Load all of the content into a javascript array and each time a link is clicked, call a javascript function to print out the corresponding element in the array.
2) Use Ajax and get the content from other places on your server and print the data out according.
I'd say go with the first solution unless you have a lot of content that you want to display for each link. If that is the case, then you are probably better off going with the second.
Try to code this for yourself to see how far you can get. If you need further help, the folks over in the javascript forum will be happy to assist :)
Good luck!
<IFRAME SRC="example.html" FRAMEBORDER="0" SCROLLING="no" WIDTH="1024" HEIGHT="768" TITLE="mydata_page">
Also I was wondering, does each page that is suppose to load have content on it that will change often? If no, if you are opposed to refreshing, you could simply use anchors to navigate around a page that contains all of your links.
<a name="label">Text to be displayed</a>
albeit not very elegant it is a simple solution...(of course you do get the scroll bar thing)
Anchor links are a good idea, but when you have only one line of text and the anchor link is on the last line of the page, then it does not really display the right data, it displays everything that fits in the certain window size!