Page 1 of 1

Taking Control of basename($_SERVER['PHP_SELF']);

Posted: Thu Jul 01, 2004 12:54 pm
by NewfieBilko
Is there anyway to take control of basename($_SERVER['PHP_SELF']);

?

What i mean is, to make it store into a variable for hmmm display, usage, whatever

Posted: Thu Jul 01, 2004 12:57 pm
by feyd
it's just a normal variable, you can do almost anything you want with it as is.

Posted: Thu Jul 01, 2004 1:01 pm
by NewfieBilko
how do you figure that basename($_SERVER['PHP_SELF']); is a usable variable

I mean if you wanted to pass the output of it to a database you can't just say INSERT "basename($_SERVER['PHP_SELF']);" lol

you know what i mean?

Posted: Thu Jul 01, 2004 1:03 pm
by markl999
I mean if you wanted to pass the output of it to a database you can't just say INSERT "basename($_SERVER['PHP_SELF']);" lol
Sure you can.

Code: Select all

$sql = "INSERT INTO foo (filename) VALUES ('".basename($_SERVER['PHP_SELF'])."')";

Posted: Thu Jul 01, 2004 1:34 pm
by NewfieBilko
right, ($_SERVER['PHP_SELF']) is an array variable

and i can just use it in all ways? weiurd, cause i was having some problems pulling the data from it into a template.
$mark= ($_SERVER['PHP_SELF'])

then template {echo $mark}
but i guess what your saying is that since its a global variable i should be able to use it in my template too ($_SERVER['PHP_SELF']) in the templating file ...