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

RE: [NTO] php syntax mistake?

Expand Messages
  • Bob Janes
    Hi Jonathan, I made the mistake of posting my first version then going off to have a bath . . . Here s the slightly more elegant revised version. +++++
    Message 1 of 5 , Jan 24, 2007
    • 0 Attachment
      Hi Jonathan,

      I made the mistake of posting my first version then going off to have a bath
      . . . Here's the slightly more elegant revised version.

      +++++

      $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

      $page_to_load = $home;

      if ( in_array($pagina, $pagina_array) ) {
      $page_to_load = $pagina;
      }

      include $page_to_load;
      echo "</div></div>";

      +++++


      Best wishes

      Bob

      --
      Bob Janes
      bob@...

      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





      Yahoo! Groups Links
    • Jonathan Woodbridge.com
      Hello Bob, ... thinking is always dangerous! thanks so much for this, it works great. I still can t exactly see why the old code doesn t work, but then, I ve
      Message 2 of 5 , Jan 25, 2007
      • 0 Attachment
        Hello Bob,

        > I made the mistake of posting my first version then going off
        > to have a bath . . . Here's the slightly more elegant revised version.

        thinking is always dangerous! thanks so much for this, it works great.

        I still can't exactly see why the old code doesn't work, but then, I've
        never gotten very far with php or c or anything except WordBasic.

        I run a website for Peace Brigades International, we send volunteers to
        accompany human rights activists who are threatened for their work. Your
        code just got our Spanish language pages on our project in Guatemala up and
        running again at www.peacebrigades.org/guatemala

        Enjoy Brittany: when I was a boy, I used to vacation in Le Val Andre, not so
        far away, I think. Glad someone else likes Spencer Brown's Laws of Form.

        best,

        Jonathan
      Your message has been successfully submitted and would be delivered to recipients shortly.