Loading ...
Sorry, an error occurred while loading the content.

7626RE: [NTO] php syntax mistake?

Expand Messages
  • Bob Janes
    Jan 24, 2007
    • 0 Attachment
      Hi Jonathan,

      Jonathan Woodbridge.com wrote:
      > I'm trying to edit very simple old php code in an html page that includes
      other files, such as header, body, menu and footer.

      I've just got back to the office and seen this, I guess you have it fixed by
      now but if not this should work.

      As someone else said you're using the same variable name twice. There are
      also a couple of odd line-breaks but they may be a result of e-mail
      formatting. Here's a chunk of slightly simpler code that should do it for
      you; notice that I've re-named the array to $pagina_array


      $pagina_array = array("accomp2004", "blanco", "cabeza", "comotrabaja",
      "contact", "cuerpo", "docshist", "gallery", "globali", "guatereports",
      "historia", "home", "impuni", "mandato", "orgs", "menu", "pie", "tierra",
      "trabajo2003", "vols");

      //check $page variable called is in ok page array above

      if ( in_array($pagina, $pagina_array) ) {
      include $pagina;
      } else {
      include $home;
      echo "</div></div>";


      Best wishes


      Bob Janes

      I do want to say a few things to the graduates . . . I ask you to give
      to your children a better world than we gave to you. I ask you to
      temper your striving for material success, for the glitter of things,
      with the drive to overcome the injustice and misery that still stalk
      our nation and our planet . . . Be steadfast, be strong, be of good
      cheer. ~ Vernon E Jordan, Jr
    • Show all 5 messages in this topic