Getting started

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am new to php and just using it to replace frames and simplify code. I
have a website with 7 sections. Each section can be identified by a

The user can click on any one of 7 buttons to choose a section.

I want a different colour for the button of the page that is activated.

I have tried this
<?php $page = 1 ?>       'to number the active page

Then to colour the buttons.... I want to choose between two different
colour buttons from within a defined table.

<td WIDTH="83" BACKGROUND="buttons_etc/      'first part of button code
selects directory where file is

<?php                                  'identify php code

if ( $page1 == 1 )                     'if page is 1

           'orange button

else                                    ' or do this

               'red button

?>                                      end php code

This way it should dynamically create either of the following lins of

<td WIDTH="83" BACKGROUND="buttons_etc/top-menubutton-red.gif>
<td WIDTH="83" BACKGROUND="buttons_etc/top-menubutton-orange.gif>

But it doesn't. I need some help to grasp this syntax.

Garry Jones

Re: Getting started

<Mon, 20 Feb 2006 15:07:30 +0100>

Quoted text here. Click to load it

<td WIDTH="83" BACKGROUND="buttons_etc/<?php print $orange; ?>">

Site Timeline