Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

[PHP3] Sessions, please anyone? Very urgent! From: Pedro Fonseca (pedro.fonseca <email protected>)
Date: 05/05/00

I have a serious problem that I have to solve very soon, and I would thank
so much if someone out there could help me out! Here's the problem:

When a user clicks the catalog section of my website, a session variable
'$permission' is checked, in the beggining of file 'catalog.php', to see if
the user has permission to access the section. If he hasn't, a login form
is written on the page (instead of the catalog). This form is submited to
file 'process_login.php' which does the necessary user authentication,
writes session variable '$permission' accordingly and loads 'catalog.php'
(through use of the header() function).

When the 'catalog.php' is again loaded, '$permission' should hold the
necessary value so that the catalog section could be written on the page,
instead of the login one. Unfortunately this does not happen, and so the
login form keeps appearing again on the screen every time I submit the
form. It seems that after the first login submit, '$permission' no longer
exists!

However, if the browser is refreshed after the first login submit all works
perfectly!

Things to know:
. both 'catalog.php' and 'process_login.php' have session_start()
. '$permission' is session_register()ed in 'index.php'

Please, anyone?

    Pedro Fonseca

/**
 * home: pedro.fon <email protected>
 * work: pedro.fonseca <email protected>
 * URL: http://students.iscte.pt/~a17253/aminhapagina/
 *
 * Mobile: 96.906.60.95
 *
 * Av. Capitão António Gomes Rocha nº8 3ºEsq.
 * 2745-245 QUELUZ
 * Portugal
 *
 **/

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>