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: [EMAIL PROTECTED]

> -----Original Message-----
> From: Hannes Smit [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, 13 January 2003 9:48 AM
> To: [EMAIL PROTECTED]
> 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
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to