|
Posted by Chris on 11/03/07 08:59
On 3 Nov, 06:12, Chris Gorospe <ch...@ekast.com> wrote:
> Chris wrote:
> > I am trying to increase/decrease the value of $_SESSION['count'] by 1
> > after clicking on a link e.g index.php?gotoWk=nxtWk and index.php?
> > gotoWk=lstWk. I'm sure you will get the drift if you look at the code
> > below.
>
> > However, this code seems to be unreliable. Is there a more robust way
> > of achieving the same thing?
>
> > Many thanks,
>
> > Chris
>
> > if (!isset($_SESSION['count'])) {
> > $_SESSION['count'] = 0;
> > } elseif($_REQUEST['gotoWk'] == "nxtWk") {
> > $_SESSION['count']++;
> > } elseif($_REQUEST['gotoWk'] == "lstWk") {
> > $_SESSION['count']--;
> > }
>
> I don't see what why you think it's unreliable. Looks like it should do
> exactly what you're explaining you want done. The only thing i'd
> personally change is the $_REQUEST. I would use $_GET instead.- Hide quoted text -
>
> - Show quoted text -
It is not reliable in that when a link is clicked it doesn't always
add or take away 1 appropiately?
Cheers,
Chris
Navigation:
[Reply to this message]
|