RE: [PHP] object in session & security
| From: | Timothy Hitchens \(HiTCHO\) | Date: | Sun, 12 Jan 2003 23:58:30 +0000 |
| Subject: | RE: [PHP] object in session & security | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131377@lists.php.net to get a copy of this message | ||
It is viewable from the script only not the outside world eg the visitor
to the website
unless you output it.
Also you are better offer having your vars set by methods from a
constructor then you can
do what you just showed below.
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim@hitcho.com.au
> -----Original Message-----
> From: Hannes Smit [mailto:hannes_fly@hotmail.com]
> Sent: Monday, 13 January 2003 9:48 AM
> To: php-general@lists.php.net
> Subject: [PHP] object in session & security
>
>
> Hello,
>
> Im building a object oriented webapplication with PHP. I know
> PHP doesnt fully support OOP. I made a class called Database.
> This class contains several variables. One of these vars is
> the username and the password for the database. When i create
> a Database object I want to register it in the applications
> session, so it available through the whole app. Is this
> secure? is it possible to view this variable from the
> outside? To make it more secure i tried 'crypt()'. But this
> doesnt work in this way:
>
> class Database{
> var $server="db.provider.com";
> var $username="myusername";
> var $password=crypt("8d3j22d");
> var $database="webshop";
> }
>
> it results in:
>
> Parse error: parse error, unexpected T_VARIABLE, expecting
> T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>