Anthony Niemann
|
| Posted: 03/17/2002, 8:25 PM |
|
I want to do a comparison to see which actual page I am displaying while in
the header page. I noticed that the following lines exist in the php for the
actual page
$filename = "Home.php";
$tpl->set_var("FileName", $filename);
However, all references to this variable (get_param("FileName")) in the
header page return a blank string. Is there a way to do this?
Thanks,
Tony
|
|
|
 |
Alexey Alexapolsky
|
| Posted: 03/18/2002, 4:46 AM |
|
use global variables :
global $PHP_SELF;
$tpl->set_var("FileName", $PHP_SELF);
--
Alex
CodeCharge Developer
"Anthony Niemann" <tony@removethis.zierniemann.com> wrote in message
news:a73q8e$7m7$1@news.codecharge.com...
> I want to do a comparison to see which actual page I am displaying while
in
> the header page. I noticed that the following lines exist in the php for
the
> actual page
> $filename = "Home.php";
>
> $tpl->set_var("FileName", $filename);
>
> However, all references to this variable (get_param("FileName")) in the
> header page return a blank string. Is there a way to do this?
>
> Thanks,
>
> Tony
>
>
>
|
|
|
 |
Anthony Niemann
|
| Posted: 03/18/2002, 8:59 AM |
|
Are you saying that if I reference the global variable $PHP_SELF I will get
the page name?
I'm not wanting to set it, I'm wanting to retrieve it for a comparison
operation.
Thanks,
Tony
"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:a74njl$3rt$2@news.codecharge.com...
> use global variables :
>
> global $PHP_SELF;
> $tpl->set_var("FileName", $PHP_SELF);
>
>
> --
> Alex
> CodeCharge Developer
|
|
|
 |
Alexey Alexapolsky
|
| Posted: 03/18/2002, 9:19 AM |
|
You don't need to set it.
PHP sets it automatically.
--
Alex
CodeCharge Developer
"Anthony Niemann" <tony@removethis.zierniemann.com> wrote in message
news:a756cn$1c9$1@news.codecharge.com...
> Are you saying that if I reference the global variable $PHP_SELF I will
get
> the page name?
>
> I'm not wanting to set it, I'm wanting to retrieve it for a comparison
> operation.
>
> Thanks,
> Tony
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:a74njl$3rt$2@news.codecharge.com...
> > use global variables :
> >
> > global $PHP_SELF;
> > $tpl->set_var("FileName", $PHP_SELF);
> >
> >
> > --
> > Alex
> > CodeCharge Developer
>
>
>
|
|
|
 |
Anthony Niemann
|
| Posted: 03/18/2002, 1:01 PM |
|
I put the following code in the Header page Before Show event:
$fldField1= tohtml($PHP_SELF)
When a page is displayed that uses this Header page, this field ($fldField1)
is empty.
Am I losing my mind?
|
|
|
 |
Alexey Alexapolsky
|
| Posted: 03/19/2002, 4:37 AM |
|
as I've pointed in the example above , before using PHP_SELF
you must declare it global , so that it could be
visible as it belongs to another variable scope
--
Alex
CodeCharge Developer
"Anthony Niemann" <tony@removethis.zierniemann.com> wrote in message
news:a75kjg$sbl$1@news.codecharge.com...
> I put the following code in the Header page Before Show event:
>
> $fldField1= tohtml($PHP_SELF)
>
> When a page is displayed that uses this Header page, this field
($fldField1)
> is empty.
>
> Am I losing my mind?
>
>
|
|
|
 |
Anthony Niemann
|
| Posted: 03/19/2002, 6:45 AM |
|
thanks, i wasn't paying close enough attention....
"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:a77ben$j4$2@news.codecharge.com...
> as I've pointed in the example above , before using PHP_SELF
> you must declare it global , so that it could be
> visible as it belongs to another variable scope
>
> --
> Alex
> CodeCharge Developer
>
>
> "Anthony Niemann" <tony@removethis.zierniemann.com> wrote in message
>news:a75kjg$sbl$1@news.codecharge.com...
> > I put the following code in the Header page Before Show event:
> >
> > $fldField1= tohtml($PHP_SELF)
> >
> > When a page is displayed that uses this Header page, this field
> ($fldField1)
> > is empty.
> >
> > Am I losing my mind?
> >
> >
>
>
>
|
|
|
 |
|