Re: ForEach Range Problems
| From: | Miller, Terion | Date: | Fri, 31 Jul 2009 20:10:07 +0000 |
| Subject: | Re: ForEach Range Problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296142@lists.php.net to get a copy of this message | ||
On 7/31/09 3:08 PM, "Bastien Koert" <phpster@gmail.com> wrote:
On Fri, Jul 31, 2009 at 3:10 PM, Miller,
Terion<tmiller@springfi.gannett.com> wrote:
>
>
>
> On 7/31/09 2:00 PM, "Miller, Terion" <tmiller@springfi.gannett.com> wrote:
>
>
>
>
> On 7/31/09 1:56 PM, "Bastien Koert" <phpster@gmail.com> wrote:
>
> $letters = '';
>
> Nope still gives the same error: Notice: Undefined index: letter
>
> Well getting closer with this but now my output menu is not a clickable link?
>
> $letter = isset($_GET['letter'])
> ? $_GET['letter'] :"";
> //Create array with letters AND number sign
> $letters = range('A','Z'); array_push($letters,
> '#'); $menu = '';
> foreach($letters as $letter) { $menu .= ($letter)
> ? sprintf('%s', $letter) :
> sprintf('<a href="browse.php?letter=%s">%s</a> ', $letter,
> $letter); } echo
> "<div align=\"center\"><b>{$menu}</b><br
> /></div>";
>
check the view source for the link to see what is happening to make it fail
--
Bastien
Cat, the other other white meat
I finally got it working pretty much..next I just have to apply it to the query so that if the user
clicks the # it will pull the records that begin with a number instead of letter from the db...
On the home stretch...