atom feed20 messages in com.googlegroups.professional-php[Pro. PHP Dev.] Re: IF VAR = X, THEN ...
FromSent OnAttachments
JorgeNov 19, 2008 10:10 pm 
Robert GonzalezNov 19, 2008 10:17 pm 
JorgeNov 19, 2008 10:20 pm 
Fahd MurtazaNov 19, 2008 10:21 pm 
JorgeNov 19, 2008 10:23 pm 
Fahd MurtazaNov 19, 2008 10:25 pm 
Fahd MurtazaNov 19, 2008 10:34 pm 
JorgeNov 19, 2008 10:37 pm 
JorgeNov 19, 2008 10:38 pm 
Fahd MurtazaNov 19, 2008 10:40 pm 
Robert GonzalezNov 19, 2008 10:54 pm 
Fahd MurtazaNov 19, 2008 10:57 pm 
David DyessNov 19, 2008 11:00 pm 
MattNov 20, 2008 6:14 am 
Robert GonzalezNov 20, 2008 7:12 am 
Fahd MurtazaNov 20, 2008 7:24 am 
JorgeNov 20, 2008 3:38 pm 
Robert GonzalezNov 20, 2008 3:42 pm 
Jorge Eduardo GonzalezNov 20, 2008 3:59 pm 
Robert GonzalezNov 20, 2008 4:05 pm 
Subject:[Pro. PHP Dev.] Re: IF VAR = X, THEN CSS CLASS =
From:Jorge (
Date:Nov 19, 2008 10:38:09 pm

Sorry.. I think we posted simultaneously.

On Nov 20, 1:37 am, Jorge <> wrote:

Fahd, In the static version of the list, would the sintax per line be something like

  <li><a href="\projects\3090\index.php"

<?PHP   if($PROJ==3091)       {           echo "class = 'selected'";       }       else       {           echo "class = 'nonselected'";       }

?>  >PROJECT1</a></li>

On Nov 20, 1:26 am, "Fahd Murtaza" <> wrote:


then all you would need to do is, use a parameter which defines the current project after you create the list. Then when you click on an object. The following pages have the same list but you have an additional variable like $current_project which you can compare with all the variables ion the list and if both are equal, all you have to do is, echo a class="selected" for the list item.

On Thu, Nov 20, 2008 at 11:20 AM, Jorge <> wrote:

Not yet Robert. As of now, it is a static list, however, once I learn how to generate it from the DB, it will be. (I do have a DB setup with all of the menu names), but again, the current list is an HTML list which I am inserting in the page via INCLUDE

On Nov 20, 1:18 am, "Robert Gonzalez" <> wrote:

Are you looping to create the list items?

On Wed, Nov 19, 2008 at 10:10 PM, Jorge <> wrote:

I am developing a simple website where the menu of projects on the left of the page also serves as the navigation tool telling you which project page you are on.

So, if you can imagine the menu on the left:


These line items are formatted via CSS:

<li><a href="\projects\3090\index.php" class="nonselected">PROJECT1</ a></li> <li><a href="\projects\3091\index.php" class="selected">PROJECT2</a></ li> <li><a href="\projects\3092\index.php" class="nonselected">PROJECT3</ a></li> <li><a href="\projects\3093\index.php" class="nonselected">PROJECT4</ a></li>

Is there a simple way to vary the class from "nonselected" to "selected" via a variable and if/then?

If var PROJ=3091, then class="selected"; else, class="nonselected"

I will appreciate any help with this.

Thank you,

-- Robert A. Gonzalez- Hide quoted text -

- Show quoted text -

-- Regards Fahd Murtaza quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -

--~--~---------~--~----~------------~-------~--~----~ This group is managed and maintained by the development staff at 360 PSG. An
enterprise application development company utilizing open-source technologies
for todays small-to-medium size businesses.

For information or project assistance please visit :

You received this message because you are subscribed to the Google Groups
"Professional PHP Developers" group. To post to this group, send email to To unsubscribe from this group, send email to For more options, visit this group at -~----------~----~----~----~------~----~------~--~---