You are here: Re: using session instead of passing thru URL- newbie « PHP Programming Language « IT news, forums, messages
Re: using session instead of passing thru URL- newbie

Posted by Matt Madrid on 08/04/07 06:14

comatose wrote:
> Sorry if I don’t explain all the terms correctly, but I’m a newbie.
>
> how can i change this code to accept a session for which week they
> choose, with register_globals = on it worked fine, but my web hosting
> site has changed register globals to off and I’d like to keep it off
> and learn to program without passing variables in the URL.
>
>
> for($i=1;$i<=17;$i++){
> echo "<a
> href='http://".mysite.com."/pool/make_picks_form.php?week=$i'>".$i."</a>";
> echo "&nbsp&nbsp&nbsp&nbsp ";
> }
>
> So my question is how to add a session[‘chngweek’] so I know which
> week they picked to view.

session_start();
$_SESSION['week'] = $_REQUEST['week'];


You should read:
http://www.php.net/manual/en/ref.session.php
and
http://www.php.net/manual/en/reserved.variables.php

 

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

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