RE: [PHP] link generating script
| From: | Ryan A | Date: | Mon, 25 Apr 2005 17:10:16 +0000 |
| Subject: | RE: [PHP] link generating script | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-213814@lists.php.net to get a copy of this message | ||
Hey,
This is a common mistake...have a look at what you wrote:
>if ($n=$Pagenum) {print ' <strong> ' . $n;}
take a look again....see the problem?
The above will always validate to true...reason being...you gotto use the
equal to equal to instead of just equal to...like this:
if ($n==$Pagenum) {print ' <strong> ' . $n;}
Hope that helped.
Cheers,
Ryan
On 4/25/2005 6:40:24 PM, Ed Dorsch (edorsch@uoregon.edu) wrote:
> Thanks Ryan!
>
>
>
> I'm having a difficult time, though, with the exact syntax. And where,
exactly, to nest the If > then. I tried this, but it didn't
> work. Nothing displayed and I think it got caught in an endless loop:
>
>
>
> $max=20;
>
> $max++;
>
> for ($n = 1; $n < $max; $n++)
>
>
>
> if ($n=$Pagenum) {print ' <strong> ' . $n;}
>
>
>
> else
>
>
>
> {print ' <a
> href="pag_gallery.php?Pagenum='.$n.'"'.'>'.$n.'</a>';}
>
> print ' <br><br>';
>
>
>
>
>
>
>
> -----Original Message-----
>
> From: Ryan A [mailto:ryan@coinpass.com]
>
> Sent: Monday, April 25, 2005 8:47 AM
>
> To: Ed Dorsch
>
> Cc: php
>
> Subject: Re: [PHP] link generating script
>
>
>
>
>
>
>
> On 4/25/2005 5:23:16 PM, Ed Dorsch (edorsch@uoregon.edu) wrote:
>
> >
> I'm scripting a photo gallery page that generates links (1 through $max),
> sends the selected number in the url, then displays a set of photos based
on
> the number. However, I want it to display the number of the current
gallery
> diffe
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.2 - Release Date: 4/21/2005