View previous topic :: View next topic |
Author |
Message |
noamkrief -
Joined: 12 Nov 2003 Posts: 40
|
Posted: Thu Jan 08, 2004 7:10 am Post subject: is there a function to ignore undefined variables? |
|
|
Is there a special command i can put on top of a php page that would ignore undefined variables?
thank
Noam |
|
Back to top |
|
 |
whackaxe -
Joined: 28 Jun 2003 Posts: 90
|
Posted: Thu Jan 08, 2004 2:10 pm Post subject: |
|
|
you can check if a variable is set by using the isset function for example
Code: |
if (!isset($myvar))
{
print("not set')
}
else
{
print("set!");
}
|
the ! in front of isset means "isn't" in normal english you could just take it off and invert the messages _________________ and remeber kids! keep the forums clean! |
|
Back to top |
|
 |
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Thu Jan 08, 2004 2:13 pm Post subject: |
|
|
Put this at the top of your page:
error_reporting (E_ERROR | E_WARNING | E_PARSE);
or you can go into your php.ini file and turn off notices
for all php pages. :wink: |
|
Back to top |
|
 |
noamkrief -
Joined: 12 Nov 2003 Posts: 40
|
Posted: Thu Jan 08, 2004 3:10 pm Post subject: |
|
|
both of those worked great.
I like to use both options. Turning off the error reporting seems to be better security over my code and sql database...
thank you both
Noam |
|
Back to top |
|
 |
whackaxe -
Joined: 28 Jun 2003 Posts: 90
|
Posted: Thu Jan 08, 2004 6:22 pm Post subject: |
|
|
its ideal to turn on all warnings in a developmen enviroment, but in a production enviroment, for security reasons, yo should turn it off _________________ and remeber kids! keep the forums clean! |
|
Back to top |
|
 |
goose -
Joined: 17 Sep 2002 Posts: 608 Location: The Land Of OZ! come here toto!
|
Posted: Thu Jan 08, 2004 10:14 pm Post subject: |
|
|
hmmm maybe i can use this in guppy's webportal
to get it running! :wink: _________________ living in an armish paradise.....no gates here!
mawuahahaha :) |
|
Back to top |
|
 |
|