CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 FileName help (PHP4)

Print topic Send  topic

Author Message
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?
> >
> >
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.