Re: [PHP] tabbed navegation PHP



you are right.. i still need to learn alot.. ;) this is my first php site.
:-(


""Zoltán Németh"" <znemeth@xxxxxxxxxxxxxx> wrote in message
news:1175260456.5023.52.camel@xxxxxxxxxxxxxxx
2007. 03. 30, péntek keltezéssel 15.05-kor Dwayne Heronimo ezt írta:
Dear All,

I have made a tabbed navegation with CSS. And if you set class="active"
to
one of the tabs, it will then be highlighted.
So I thought to make this dymamic with PHP. Using the $_GET variable I
can
get the page name above with something like. $page_name = $_GET['page'] ;
so I can tell the class when to be active to what page.

Should I use the isset function for this? I am very new to PHP but here
is
my try, but of course its not working:

<?php
if (isset ($_GET['page'])) {

$page_name = $_GET['page'] ;

if ($page_name = "default") {
$flg_page_default=1;
}
if ($page_name = "about") {
$flg_page_about=1;
}

}
?>

I think you should read

http://www.php.net/manual/en/language.operators.php

carefully. with the

if ($page_name = "default)

statement you assign the value "default" to $page_name, not checking
equality. that could be done by ==


greets
Zoltán Németh




<a <?php if(!isset($flg_page_default)) echo 'class="active"'; else echo
'';
?> href="index.php?page=default"><span>home</span></a>
<a <?php if(!isset($flg_page_about)) echo 'class="active"'; else echo '';
?>
href="index.php?page=default"><span>about</span></a>


Of should I stick to just static html :(

Dwayne

.



Relevant Pages

  • Re: [PHP] tabbed navegation PHP
    ... I have made a tabbed navegation with CSS. ... one of the tabs, ... So I thought to make this dymamic with PHP. ... Should I use the isset function for this? ...
    (php.general)
  • Re: [PHP] tabbed navegation PHP
    ... I have made a tabbed navegation with CSS. ... one of the tabs, ... So I thought to make this dymamic with PHP. ... Should I use the isset function for this? ...
    (php.general)
  • tabbed navegation PHP
    ... I have made a tabbed navegation with CSS. ... one of the tabs, ... So I thought to make this dymamic with PHP. ... Should I use the isset function for this? ...
    (php.general)
  • Re: [PHP] tabbed navegation PHP
    ... Dwayne Heronimo wrote: ... And if you set class="active" to one of the tabs, ... So I thought to make this dymamic with PHP. ... Should I use the isset function for this? ...
    (php.general)
  • Re: [PHP] Couple of beginner questions
    ... The custom tag will expand the path to wherever the images directory was ... It's a pain in the ass overriding a CSS rule that was ... wherever I can't simply redefine the html tag. ... infact ideally an html tag should never be seen in a php script ...
    (php.general)