Skip to main content

Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24486
    bagito
    Participant

    hi there,

    when a programmer saw my code in php and css.. he said that i should separate my codes..
    example:

    Code:
    function fNavi() {
    $list = a class=’navi’ href=’#’>HOME;
    $list .= ]CONTACT;
    return $list;
    }
    echo fNavi();

    and i dont understand what he was trying to tell me..he said it’s a wrong practice embedding the html/css tags in my php code.

    i really wanted to learn and improve my code in a professional way , good practice.

    can somebody help me…. thanks

    #55786
    apostrophe
    Participant

    Create your nav as normal html

    Code:

    and save it as nav.php.inc

    Then in your html page, where ever you want it to appear

    Code:

    EDIT:
    Obviously you would save your html page with the .php extension. eg. index.php

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.