You are here: Help with session count code « PHP Programming Language « IT news, forums, messages
Help with session count code

Posted by Chris on 11/02/07 23:19

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']--;
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация