Quick question phprz. Is it ok to put a token inside a define()
statement?
IE:
define('TOKEN', $sometoken);
I guess what I am really after is if this can be read by a hacker?
I may be misguided as to what define()'s parameters are.
Once you define something it becomes a server variable?
And se
On Dec 17, 2007 8:15 AM, Johannes Skov Frandsen <[EMAIL PROTECTED]> wrote:
> Hi everybody
>
> This post is not so much a question to solve a problem but more in the
> direction: what would you do and why.
>
> I'm starting a new project and is preparing the basic layout for the
> application. In al
Hi everybody
This post is not so much a question to solve a problem but more in the
direction: what would you do and why.
I'm starting a new project and is preparing the basic layout for the
application. In all my previous projects I have had a config file that
all other files would require
On Thu, April 26, 2007 5:43 am, Tijnema ! wrote:
> On 4/20/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
>> > I thought I could define() and array. However, when I do this:
>>
>> Nope. :-(
>>
>> Has to be string or int or boolean or float o
Chris wrote:
Tijnema ! wrote:
On 4/20/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
> I thought I could define() and array. However, when I do this:
Nope. :-(
Has to be string or int or boolean or float or other "scalar" type.
> define(
Tijnema ! wrote:
On 4/20/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
> I thought I could define() and array. However, when I do this:
Nope. :-(
Has to be string or int or boolean or float or other "scalar" type.
> define("THECONSTANT",
On 4/20/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
> I thought I could define() and array. However, when I do this:
Nope. :-(
Has to be string or int or boolean or float or other "scalar" type.
> define("THECONSTANT", array(1,2,3));
>
On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
> I thought I could define() and array. However, when I do this:
Nope. :-(
Has to be string or int or boolean or float or other "scalar" type.
> define("THECONSTANT", array(1,2,3));
> print_r(THECONSTANT);
>
> it prints THECONSTANT and not
[EMAIL PROTECTED] wrote:
I thought I could define() and array. However, when I do this:
define("THECONSTANT", array(1,2,3));
print_r(THECONSTANT);
it prints THECONSTANT and not the array :(
according to the manual:
bool define ( string $name, mixed $value [, bool $case_insensitive] )
And isn
[EMAIL PROTECTED] wrote:
Hi,
I thought I could define() and array. However, when I do this:
define("THECONSTANT", array(1,2,3));
print_r(THECONSTANT);
it prints THECONSTANT and not the array :(
according to the manual:
bool define ( string $name, mixed $value [, bool $case_insensitive] )
An
Hi,
I thought I could define() and array. However, when I do this:
define("THECONSTANT", array(1,2,3));
print_r(THECONSTANT);
it prints THECONSTANT and not the array :(
according to the manual:
bool define ( string $name, mixed $value [, bool $case_insensitive] )
And isn't "mixed" of any typ
At 07:56 PM 2/8/2006, Matt Arnilo S. Baluyos (Mailing Lists) wrote:
I have a config.inc.php file which basically contains all the
configuration info that the applications needs (directory/file
locations, database credentials, etc). The information there is set
using the define() function.
Howeve
tedd wrote:
Matt:
That should've been my follow up question - which is, if define() is a
lot safer and more elegant to use than variables, why do many projects
use variables?
My use of CONSTANCE's and variables depend upon need. If I require a
constant throughout the main() portion of my co
Matt:
That should've been my follow up question - which is, if define() is a
lot safer and more elegant to use than variables, why do many projects
use variables?
My use of CONSTANCE's and variables depend upon need. If I require a
constant throughout the main() portion of my code, then I use
On 2/9/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
> bare in mind though that define() is horribly slow (to paraphrase
> Rasmus) which may be the reason many projects choose to use variables
> instead. see here:
Thanks Chris and Jochem!
That should've been my follow up question - which is, if defi
Chris wrote:
Hi Matt,
I use define's.
me too. mostly because unless you use the runkit extension or
something you can't undefine or change the values of a constant.
bare in mind though that define() is horribly slow (to paraphrase
Rasmus) which may be the reason many projects choose to use va
Hi Matt,
I use define's.
With variables it's easy to forget to global'ise it when you go into a
function, define's don't have this issue.
Matt Arnilo S. Baluyos (Mailing Lists) wrote:
Hello Everyone,
I have a config.inc.php file which basically contains all the
configuration info that the a
Hello Everyone,
I have a config.inc.php file which basically contains all the
configuration info that the applications needs (directory/file
locations, database credentials, etc). The information there is set
using the define() function.
However, I've seen some open-source projects which either u
[snip]
> now that was exactly my reasoning ... but I very much appriciate the
input
> of the more experienced/older/classically-trained (as apposed to my
> completely
>
-self-taught-not-backed-up-with-any-solid-computer-science-theory-skills
)
> guys out there (hey Jay it's a compliment ;-)
Jay's
[snip]
> I may be misunderstanding you here, but I don't see why you would not
> want to use a variable to define a constant. I do it from time to
time,
> most common would be in a config document where I'll check if the page
> is being accessed via http or https, and define a constant based on
On Jul 28, 2005, at 9:41 AM, Edward Vermillion wrote:
[snip]
I may be misunderstanding you here, but I don't see why you would
not want to use a variable to define a constant. I do it from
time to time, most common would be in a config document where I'll
check if the page is being acces
Jochem Maas wrote:
now that was exactly my reasoning ... but I very much appriciate the input
of the more experienced/older/classically-trained (as apposed to my
completely
-self-taught-not-backed-up-with-any-solid-computer-science-theory-skills)
guys out there (hey Jay it's a compliment ;-)
John Nichel wrote:
Jay Blanchard wrote:
[snip]
never want to use a variable to determine a constant
because the variable is not likely to be the same (that is why we call
them variables) on any iteration. Using constants in expressions is OK,
for instance
if(BAR == $foo){
...stuff...
}
But
John Nichel wrote:
Jay Blanchard wrote:
[snip]
if($bars == 3)
{
define('BAR', 1);
}
then:
if(BAR)
{
That's an incorrect use for constants. Use variables for that =]
WHY?
[/snip]
Because the constant can be variable in this case. Consider (this is old
school, and we all know that I
Jay Blanchard wrote:
[snip]
if($bars == 3)
{
define('BAR', 1);
}
then:
if(BAR)
{
That's an incorrect use for constants. Use variables for that =]
WHY?
[/snip]
Because the constant can be variable in this case. Consider (this is old
school, and we all know that I am the definition of o
Sebastian wrote:
i never really used constants before so this may sound stupid..
when you define a constant using define() and want to return true/false
is this logical:
if($bars == 3)
{
define('BAR', 1);
}
then:
if(BAR)
{
// bars is true
}
or should i need to do an else statement as
Exactly,
CONSTANTS are ... "eternal truths" to the program, they shouldn't
change, constants should not be changing based on arguments being
passed, or other variables.
by definition, it's no longer a constant, and a misuse of the define
() function.
On Jul 28, 2005, at 8:46 AM, Jay Bl
On Thu, 2005-07-28 at 14:41 +0200, Jochem Maas wrote:
> André Medeiros wrote:
> > On Wed, 2005-07-27 at 17:17 -0400, Sebastian wrote:
> >
> >>i never really used constants before so this may sound stupid..
> >>when you define a constant using define() and want to return true/false
> >>is this log
[snip]
>>if($bars == 3)
>>{
>>define('BAR', 1);
>>}
>>
>>then:
>>
>>if(BAR)
>>{
> That's an incorrect use for constants. Use variables for that =]
WHY?
[/snip]
Because the constant can be variable in this case. Consider (this is old
school, and we all know that I am the definition of old scho
André Medeiros wrote:
On Wed, 2005-07-27 at 17:17 -0400, Sebastian wrote:
i never really used constants before so this may sound stupid..
when you define a constant using define() and want to return true/false
is this logical:
if($bars == 3)
{
define('BAR', 1);
}
then:
if(BAR)
{
...
On Wed, 2005-07-27 at 17:17 -0400, Sebastian wrote:
> i never really used constants before so this may sound stupid..
> when you define a constant using define() and want to return true/false
> is this logical:
>
> if($bars == 3)
> {
> define('BAR', 1);
> }
>
> then:
>
> if(BAR)
> {
> /
Sebastian wrote:
i never really used constants before so this may sound stupid..
you could use constants and still sound stupid.
- that would be 'constantly sounding stupid' ;-)
when you define a constant using define() and want to return true/false
is this logical:
yes, if a little verbose
> i never really used constants before so this may sound stupid..
> when you define a constant using define() and want to return true/false
> is this logical:
http://us2.php.net/defined
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
i never really used constants before so this may sound stupid..
when you define a constant using define() and want to return true/false
is this logical:
if($bars == 3)
{
define('BAR', 1);
}
then:
if(BAR)
{
// bars is true
}
or should i need to do an else statement as well:
if($bars ==
On 11/08/2004, at 12:16 AM, Jay Blanchard wrote:
They should be global already...
http://us3.php.net/manual/en/language.constants.php
"Like superglobals, the scope of a constant is global. You can access
constants anywhere in your script without regard to scope. For more
information on scope, read
[snip]
If I define a constant within a function, it appears that the constant
is only defined within the namespace of the function. Fair enough.
Can I globalise these definitions?
[/snip]
They should be global already...
http://us3.php.net/manual/en/language.constants.php
"Like superglobals,
If I define a constant within a function, it appears that the constant
is only defined within the namespace of the function. Fair enough.
Can I globalise these definitions?
---
Justin French
http://indent.com.au
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.
Jason K Larson wrote:
http://www.php.net/manual/en/function.constant.php
$msg = constant('_LANG'.$num);
HTH,
--
Jason k Larson
Strange it does not work if I do:
$num = "_LANG".$num ;
$msg = constant($num) ;
echo $mgs ; //It does not display anything!
But If I do it directly, it works:
$nu
http://www.php.net/manual/en/function.constant.php
$msg = constant('_LANG'.$num);
HTH,
--
Jason k Larson
Vincent M. wrote:
Hello,
I do a lot of define like that:
define ("_LANG1", "Server options");
define ("_LANG1", "Manage your system");
etc...
And stuff like that:
if($num == 1) {
$mgs =
Hello,
I do a lot of define like that:
define ("_LANG1", "Server options");
define ("_LANG1", "Manage your system");
etc...
And stuff like that:
if($num == 1) {
$mgs = _LANG1 ;
}else if($num == 2) {
$mgs = _LANG2 ;
}
etc...
But I do want to avoid all these if and else, is there a way
> define ("DOC_HOME_PATH", "http://localhost/killerspin/web/store/";);
> define ("IMG_HOME_PATH", "http://localhost/killerspin/web/images/";);
> define ("CTL_HOME_PATH", "http://localhost/killerspin/web/control/";);
>
> Click Here
>
>
> doesn't work.
It should. The above code produces this when
I want to define 3 constants
DOC_HOME_PATH
IMG_HOME_PATH
CTL_HOME_PATH
So that I can just do this
Click Here
**do I need to echo?
**not everything goes to "stuff"
Right now I have
define ("DOC_HOME_PATH", "d:/is/projects/killerspin/web/store/");
define ("IMG_HOME_PATH", "d:/is/projects/kil
I want to define 3 constants
DOC_HOME_PATH
IMG_HOME_PATH
CTL_HOME_PATH
So that I can just do this
Click Here
**do I need to echo?
**not everything goes to "stuff"
Right now I have
define ("DOC_HOME_PATH", "d:/is/projects/killerspin/web/store/");
define ("IMG_HOME_PATH", "d:/is/projects/kil
I want to define 3 constants
DOC_HOME_PATH
IMG_HOME_PATH
CTL_HOME_PATH
So that I can just do this
Click Here
**do I need to echo?
**not everything goes to "stuff"
Right now I have
define ("DOC_HOME_PATH", "d:/is/projects/killerspin/web/store/");
define ("IMG_HOME_PATH", "d:/is/projects/kil
On Thu, 7 Mar 2002, Administration@myclassguide wrote:
> This line opens in a new window. How can i define the size of the window,
> scroll options etc.
Javascript.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi
This line opens in a new window. How can i define the size of the window,
scroll options etc.
echo "Results";
Thanks in advance
Mohamed
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi everibody
I have Apache running under Linux SuSE 7.2 with PHP/4.0.4pl1
The server the Linux and the php instalation is the standart
SuSE package instalation from the SuSE install cd-s so, everithing is
fine except one thing:
calling this test.php script in browser window:
';
if(defined("_Sc"
47 matches
Mail list logo