NYCPHP Meetup

NYPHP.org

[nycphp-talk] Designing without register_globals

Faber Fedor faber at linuxnj.com
Sat Feb 21 16:58:44 EST 2004


Hi Gang,

I'm new to the list and am in need of some expert advise.  I'm a Linux
consultant in New Jersey and PHP is one of my favorite languages
although I don't get to use it much.

One of my clients wants their website redone from scratch.  Nothing
fancy mind you, just your basic database-backed ecommerce with a
brochure-ware front-end but it does have two interesting specifications.

The one specification is the database back-end is a PICK database
implemented under Linux as jBASE.  For this reason, I can't use any
off-theshelf ecommerce packages since everyone I've come across save one
is more or less hardcoded for MySQL and or Postgresql.  There is one
person in CA that knows how to connect PHP to the jBASE database, but he
isn't talking. At least not yet.

But that's not why I'm writing to you today. The problem I'm asking you
guys about deals with the second spec.  I want the site to be easily
modified by a non-geek who knows/can learn simple HTML.  

You can see the test site by looking at http://www.trimline.us/test.

What I was thinking of doing was to take sections and put them in
separate HTML files.  The "What's new" section and the main content area
are done like that.  I simply do a  include("whatsnew.html") in the
index.php file and be done with it.  The non-geek can easily edit the
file with simple HTML.

The probelm I'm running into deals with the menu bar and the shortcuts
sections.  I'd like to be able to click on "FAQ" and have faq.html
appear in the main content area.

On my site (http://www.linuxnj.com) I've done this by passing the
variable $newpage back and forth, e.g. the URL for the  "Services" link
is "http://www.linuxnj.com/index.php?newpage=tech".  This requires
register_globals be turned on. BTW, the entire left sidebar is in a
separate file that is included().

I do NOT want register_globas on in my client's site. So I've registered
a variable called $_ENV["newpage"].  MY problem is I can't figure out
how to set the variable when a user clicks on the "FAQ" link.  On top of
that, I'm afraid I need to put PHP code in the shortcuts.html file,
which makes it more complicated for my end-user.

Hmmm, I didn't mean to ramble on so much, especially for my first post.
Sorry about that.  So does anyone have any ideas how to pull this off?
Or at least any good keywords to google with?


-- 
 
Regards,
 
Faber                     

Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com






More information about the talk mailing list