Jump to content

lpaternoster

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lpaternoster's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. If you want an idea of how I'd like it to look, see http://www.chrisgrafham.com/leon/index.html.
  2. The index.php page looks like this: <?php $section = 'home'; ?> <?php include ("http://leonpaternoster.com/inc/header.php"); ?> <?php include ("http://leonpaternoster.com/inc/navbar.php"); ?> <img src="images/russia.jpg" alt="Slightly short-sighted but eager designer at work" height="333" width="760" class="bigpic"> <div id="content"> <div id="left-col"> <h2>Simple, accessible web design</h2> <p>I design web pages that make it easy for your <em>users</em> to find the information they need. That means you make more <em>money</em> when I design your pages.</p> <p>I focus on:</p> <dl> <dt>Usability</dt> <dd>All my design is based on studies of user behaviour and user testing. This means that your users will be able to locate the information they need as effieciently as possible, which means more business for you.</dd> <dt>Accessibilty</dt> <dd>I use layout, wording and typography to ensure that as many users as possible can access the information on your website.</dd> <dt>Speed</dt> <dd>I code websites as efficiently as possible, removing unnecessary content. This means that your users will find information as quickly as possible.</dd> </dl> <p class="cta">Find out <a href="about.html">more</a>, <a href="contact.html">contact me</a> or see my <a href="prices.html">services and prices</a>.</p> </div> <?php include ("http://leonpaternoster.com/inc/right-col.php"); ?> <?php include ("http://leonpaternoster.com/inc/footer.php"); ?> The navbar.php file looks like this: <div id="navbar"> <?php echo $section; ?> <ul> <?php if ($section == 'home') { ?> <li class="current">Home</li> <?php } else { ?> <li><a href="http://leonpaternoster.com/index.php">Home</a></li> <?php } ?> <?php if ($section == 'about') { ?> <li class="current">About</li> <?php } else { ?> <li><a href="http://leonpaternoster.com/about.php">About</a></li> <?php } ?> <?php if ($section == 'contact') { ?> <li class="current">Contact</li> <?php } else { ?> <li><a href="http://leonpaternoster.com/contact.php">Contact</a></li> <?php } ?> <?php if ($section == 'prices') { ?> <li class="current">Prices</li> <?php } else { ?> <li><a href="http://leonpaternoster.com/prices/index.php">Prices</a></li> <?php } ?> <?php if ($section == 'examples') { ?> <li class="current">Examples</li> <?php } else { ?> <li><a href="http://leonpaternoster.com/examples/index.php">Examples</a></li> <?php } ?> </ul> </div> In my the-last-programming-I-did-was-on-an-Amiga way, could this be anything to do with scope (i.e. $section is local to the index.php page)? Thanks for your help, Leon
  3. No - the echo in navbar.php doesn't display anything either. Thanks, Leon
  4. Hi - I'm an absolute PHP newbie and this is my first bit of code. I'm trying to set up a navbar that displays the current link differently from the other links in the list. In order to do this, I'm declaring a variable right at the top of my HTML document. For example: <?php $section = 'home'; ?> I then include the navbar mark up using: <?php include ("inc/navbar.php"); ?> This works. However, the variable doesn't seem to have survived. This is my navbar.php file: <div id="navbar"> <?php echo $section; ?> <ul> <?php if ($section == 'home') { ?> <li class="current">Home</li> <?php } else { ?> <li><a href="index.php">Home</a></li> <?php } ?> </ul> </div> The echo command does not return anything at all, which suggests the navbar.php doesn't recognise it(?) Am I doing something wrong here? TIA, Leon
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.