Then, on each page, where $keyword is the word that the page is about, such as 'Aardvark'

$letter = substr($keyword,0,1);
loadKeywords($letter);

Dan

stargate03

01-07-2007, 01:22 AM

final thing

i have a function that returns the value of the keyword

ie

keyword();

how do i assign the value of that to the variable $keyword

stargate03

01-07-2007, 02:52 AM

ok

so now i have the correct side nav being pulled up based on first letter of the keyword

now the horrid looking bit

If i have a link say <a href=".... >A</a> as my link to all words from the list beginning with A

How do i pull that up dynamically just using a link, and the first page shown will be first in the list of keywords for that letter

whizard

01-07-2007, 04:54 AM

<a href="list.php?letter=a">A</a>

list.php

$letter = $_GET['letter'];
loadKeywords($letter);

I sense I may not be fully answering your question, since I don't really understand what you said here:

How do i pull that up dynamically just using a link, and the first page shown will be first in the list of keywords for that letter

What do you mean the 'first page'?

Dan

stargate03

01-07-2007, 03:54 PM

Ok

I have used the coding u supplied to enable the following

if i am on a page that begins with letter B - it now shows all the keyword links from the text file in navigation down the side, so i can easily move between keywords of the same letter

but now i need to have navigation along the top so that users can move between different letters

so if i click on the A letter in the navigation, i want to be taken to the first page alphabetically i.e. aardvark

If i click on B - i want to be taken to first page beginning with B i.e Bargains

But as all the keywords are in the same text file, i need a way for the navigation to work out which is the first keyword in the file for the corresponding letter

I could hard code the keyword, but that means if i add a word that is first alphabetically for a certain letter, i would have to recode the link.

hope that helps

Shaffer

01-07-2007, 05:59 PM

Ok, here is how it works.
You have only 1 page to run all of this.
The page contains a variable which is handles by the browser:
www.yoursite.com/letters.php?letter=a
You link to it this way:
<a href="www.yoursite.com/letters.php?letter=a">A</a><br/>
<a href="www.yoursite.com/letters.php?letter=b">B</a><br/>
<a href="www.yoursite.com/letters.php?letter=c">C</a><br/>
<a href="www.yoursite.com/letters.php?letter=d">D</a><br/>
etc.
The script is handled according to the url, since the variable used in the function is set by the url, as said above.
Just use the code that whizard kindly contributed in your file.
Then load it to the browser and tell us what you got. ;-)