freelanceprogrammers.org Forum Index » PHP

Need help with Session`s in PHP


View user's profile Post To page top
sha_sher Posted: Mon Aug 22, 2005 5:33 pm


Joined: 22 Aug 2005

Posts: 3
Need help with Session`s in PHP
Hi

I`ve just started doing programming in PHP.
i want to know how can i maintain session in different pages on my site.

i want to restrict people from accessing some pages on my site. and
only registered person can access that site.

i want to know how can i create and maintain session objects, and also
how to track session on different pages on my site. and through that
how can i restrict users.

At the moment i have created the
register page( for anyone to register)
login page to login to the site



i m using
PHP Version 5.0.4
MySQL server 4.1
Running on windows 2000 server with IIS 5.0

any help will be appreciated.
Thank you
Shakeeb
Reply with quote
Send private message
View user's profile Post To page top
smadaboosi Posted: Mon Aug 22, 2005 7:55 pm


Joined: 25 Feb 2005

Posts: 10
Need help with Session`s in PHP
Try phplib, I don`t know if this is maintained(updated), but you can get a whole
lot of things from there.

Sesh Madaboosi CISA, CSSA
Coherent Business Solutions LLC
www.cobizsolutions.com


Sher <sha_sher@...> wrote:
Hi

I`ve just started doing programming in PHP.
i want to know how can i maintain session in different pages on my site.

i want to restrict people from accessing some pages on my site. and
only registered person can access that site.

i want to know how can i create and maintain session objects, and also
how to track session on different pages on my site. and through that
how can i restrict users.

At the moment i have created the
register page( for anyone to register)
login page to login to the site



i m using
PHP Version 5.0.4
MySQL server 4.1
Running on windows 2000 server with IIS 5.0

any help will be appreciated.
Thank you
Shakeeb










PHP Data object relational mapping generator - http://www.meta-language.net/



---------------------------------
YAHOO! GROUPS LINKS


Visit your group "php-objects" on the web.

To unsubscribe from this group, send an email to:
php-objects-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
jlungo Posted: Mon Aug 22, 2005 9:53 pm


Joined: 05 Jun 2005

Posts: 3
Need help with Session`s in PHP
This is how i use session in my php application

(1) my login page starts the session then register the
following code variables:

<?php
session_start();
...
...
...
if ($loginFoundUser) {

$username = mysql_result($result,0,`username`);

$_SESSION[`username`] = $username;

}

(2) Then I have a file named "sesscontrol.php" with
the following codes:

<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
@$username = $_SESSION[`username`];


if(!$username){
echo ("Session Expired, <a href="../ReLogin.php">
Click Here<a> to Re-Login");
echo `<meta http-equiv = "refresh" content ="0;
url = ../ReLogin.php">`;
exit;
}
?>

(3) Now in each file i want to control access i put
the following codes:

<?php
require_once(`sesscontrol.php`);

...

This is quite enough

Lungo


--- Seshasayee Madaboosi <smadaboosi@...> wrote:

> Try phplib, I don`t know if this is
> maintained(updated), but you can get a whole lot of
> things from there.
>
> Sesh Madaboosi CISA, CSSA
> Coherent Business Solutions LLC
> www.cobizsolutions.com
>
>
> Sher <sha_sher@...> wrote:
> Hi
>
> I`ve just started doing programming in PHP.
> i want to know how can i maintain session in
> different pages on my site.
>
> i want to restrict people from accessing some pages
> on my site. and
> only registered person can access that site.
>
> i want to know how can i create and maintain session
> objects, and also
> how to track session on different pages on my site.
> and through that
> how can i restrict users.
>
> At the moment i have created the
> register page( for anyone to register)
> login page to login to the site
>
>
>
> i m using
> PHP Version 5.0.4
> MySQL server 4.1
> Running on windows 2000 server with IIS 5.0
>
> any help will be appreciated.
> Thank you
> Shakeeb

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
tariquesani Posted: Tue Aug 23, 2005 10:17 am


Joined: 23 Aug 2005

Posts: 1
Need help with Session`s in PHP
Seshasayee Madaboosi wrote:

>Try phplib, I don`t know if this is maintained(updated), but you can get a
whole lot of things from there.
>
>
phpLIB is no longer maintained but it is still usable for
Authentication - just make sure you use the PHP4 version

cheers
Tarique

--
=============================================================
PHP Applications for E-Biz: http://www.sanisoft.com

Coppermine Picture Gallery: http://coppermine.sf.net
=============================================================
Reply with quote
Send private message
View user's profile Post To page top
contact_bee Posted: Tue Aug 23, 2005 12:58 pm


Joined: 17 Jul 2005

Posts: 6
Need help with Session`s in PHP
Sher, you should get to know http://www.php.net, which is a fantastic site
for developers using PHP.

You are using PHP5. This raises the question of hosting. I would like to
experiment with PHP5, but when I contacted my (excellent) hosting site
http://www.ukfsn.org, the proprietor informed me that they would not be
upgrading any time soon. This was due to the difficulties they and their
customers experienced moving from PHP3 to PHP4.

Does anyone have any opinions on this? Any idea what the take up has been
of PHP5? Availability of free/cheap hosting companies? Is it worth the
effort of recoding and retesting numerous websites to go to PHP5?

-----Original Message-----
From: Dr Tarique Sani [mailto:tarique@...]
Sent: 23 August 2005 06:18
To: php-objects@yahoogroups.com
Subject: Re: [php-objects] Need help with Session`s in PHP

Seshasayee Madaboosi wrote:

>Try phplib, I don`t know if this is maintained(updated), but you can get a
whole lot of things from there.
>
>
phpLIB is no longer maintained but it is still usable for Authentication -
just make sure you use the PHP4 version

cheers
Tarique

--
=============================================================
PHP Applications for E-Biz: http://www.sanisoft.com

Coppermine Picture Gallery: http://coppermine.sf.net
=============================================================



------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12he2tdc7/M=362329.6886308.7839368.1510227
/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1124781330/A=2894321/R=0/SIG=11dvsfulr
/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk
back!</a>.</font>
--------------------------------------------------------------------~->

PHP Data object relational mapping generator - http://www.meta-language.net/
Yahoo! Groups Links
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help