Hmm - ya - I could do that :)

But then again that would be 2 easy!  What I ended up doing is databasing
the help system and retaining a 'rank order' in there - so that I can always
quickly calculate the next and previous - dunno why I did not do that in the
first place - but there it is :)

Thanks for the suggest Tom!


On 9/19/03 11:13 AM, "Tom Rogers" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Saturday, September 20, 2003, 12:49:52 AM, you wrote:
> MM> I am having a total brain cramp with this array problem (may have to do
> with
> MM> the pressure change from the hurricane - but whatever ;) )
> 
> MM> $helpsystem[onlineusignuphelp_username]='The username that you choose must
> MM> be more than 5 characters and 20 or less characters in length.  The
> username
> MM> must contain only numbers and letters.';
> MM> $helpsystem[onlineusignuphelp_password]='The password that you choose must
> MM> be more than 5 characters and 26 or less characters in length.  The
> username
> MM> may contain only numbers,letters, and the following characters:<br>! @ # %
> ^
> MM> *';
> 
> MM> I am building a help system of sorts.  I have the following 2 array
> members
> MM> above (set exactly as such).  When I call the page it displays like:
> 
> MM> Print $helpsystem[$_GET[tip]]
> 
> MM> I would like to display a next and previous link to help items where
> MM> possible, the problem that I am having is figureing out how to get the
> next
> MM> and previous indexes.  I can get the current key with the key() function,
> MM> and the text for the next and previous using next() and and prev() but
> MM> because the help is called by the key, I need the index to call the array
> MM> item in the url:
> MM> Help.php?tip=onlinusignuphelp_password
> 
> MM> I cannot seem to find a way to get even the current index number (i.e. 0)
> so
> MM> that I can add and subtract one to that index number...  Can anyone help
> out
> MM> with a pointer on how to get the next and prev keys?
> 
> MM> Thanks ;) 
> 
> MM> --
> MM> Cheers
> 
> MM> Mike Morton
> 
> MM> ****************************************************
> MM> *
> MM> * Tel: 905-465-1263
> MM> * Email: [EMAIL PROTECTED]
> MM> *
> MM> ****************************************************
> 
> MM> "Indeed, it would not be an exaggeration to describe the history of the
> MM> computer industry for the past decade as a massive effort to keep up with
> MM> Apple."
> MM> - Byte Magazine
> 
> MM> Given infinite time, 100 monkeys could type out the complete works of
> MM> Shakespeare. Win 98 source code? Eight monkeys, five minutes.
> MM> -- NullGrey 
> 
> 
> One way is to change your array layout like this
> 
> $helpsystem = array(
>   0 => array(
>       'title'=>'username',
>       'content'=>'The username that you choose must....'),
>   1 => array(
>       'title' =>'password',
>       'content'=>'The password that you choose must....));
> 
> Then it is easy to navigate as the next and previous will always be numerical
> keys

--
Cheers

Mike Morton

****************************************************
*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*
****************************************************

"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to