[thelist] Setting PHP variables...

Bojan Tesanovic btesanovic at gmail.com
Wed Apr 23 10:59:25 CDT 2008


You need to turn off NOTICE and/or WARNING in error_reporting
so in php.ini set
error_reporting = E_ERROR

or turn of display errors
display_errors = Off


On Apr 23, 2008, at 10:29 AM, Tris wrote:

> Hi all...
> I'm on site this week and working on a project that the server has
> Global Variables turned off(I know I know, I SHOULD be doing that by
> default..!)
>
> Anyhoo, When I needed something dynamic, I simply did:
> if (isset($_SESSION["userId"])) {
>   $showMessage = "welcome";
> }
>
> However on this server, I was getting error messages stating that the
> variable was not set.
>
> If I added a blank variable at the top of the code ' $showMessage =  
> "";  '
> that 'fixed' the big.
> However, now I have a list of about 30 variables at the top of my code
> and it looks untidy.
> There must be a better way to say to the server:
> if I asign a value to a variable, presume it exists.
>
> This only occurs when the main page requests a variable (eg
> $showMessage ) and it's not ben asigned..
> on other servers, it has just simply shown nothing, cause nothing  
> was found...
>
> Am I being a tool?
>
> Tris...
>
>
>
> -- 
> "The only people who don't make mistakes are those who don't do  
> anything"
>
> Give a man a fish and he'll feed himself for a day.
> Give a man a religion and he'll starve to death praying for a fish.
> Anon
>
> `We are what we pretend to be, so we must be careful what we  
> pretend to be.`
> Kurt Vonnegut
>
> `When a person can no longer laugh at himself, it is time for others
> to laugh at him.`
> Thomas Szasz
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !

Bojan Tesanovic
http://www.carster.us/







More information about the thelist mailing list