PORTCOMMODORE.COM / LARRYMADE.COM BLOG

Taking PHP Below the Root

I'm sure most of us PHP guys have read all the security stuff about how we can best secure our code. Lots of quick sound bits that sound all that good but trying to implement them is another story.

One that I felt was a challenge is taking my PHP code below the webroot level. While many I am sure would be satisfied with getting the choice bits under, but I was thinking it would be best if you could get as much as possible. I could better control what scripts get accessed, etc.

I wanted to make it also so everything worked through one core script. This is for my framework WANDA, which is designed to host multiple programs, so another bit was to do some cleanup work on access and menus. to make the programs closer to plugin ready.

continued

To start, the directory tree:

BELOW WEB ROOT

  • WANDA
    the directory for all things WANDA below web root.
    • APP
      plug-in applications go there…
      • MAILLIST
        a WANDA application scripts directory is same as the access group name
        • INFO.PHP
          This is the application information script that contains this app's menu listing, submenu and access settings.
    • CONF
      WANDA configuration - database settings, etc.
    • INC
      Framework script libraries.

ABOVE WEB ROOT

  • WANDA.PHP
    this is the main program has minimal code to set the base directory for the bleow root page handler, then includes that.
  • WANDA (dir)
    above root data, thongs accessed by the browser and not by the server…
    • ICON
      Icons used in the appss
    • IMAGE
      images, PDFs, etc. that also accessed directly via browser
    • SCRIPT
      CSS, Javascript modules, etc.

Unless I need a temp files directory, this will cover it. In later posts I will go over the code I've developed to get everything working in their places.

~~LINKBACK~~ ~~DISCUSSION~~

2011/07/10 21:11

Is this thing on?

Testing,, testing, if everything is right this will be on my Facebook news.

Maker Faire down next up in a couple months is CommVex - the Commdore Vegas Expo, in its 7th year of Commodore fan getting together.

VIC-20 Anniversary

Willam Shatner Hawking the VIC-20 for CommodoreRecently I revamped the CommVex page theme (CommVex Page) to resemble the Commodore VIC-20 packaging as this year signifies the VIC-20's 30th anniversary.

The VIC-20 was quite a significant computer for 1981, it was one of the first the pushed the price barrier of a quality computer below $300 (the only popular one at the time was the Timex-Slinclair ZX81 ($150) which was pretty flimsy for a home computer.

Other computers of the time were the Commodore PET and TRS-80 which were getting dated with thier monochrome display and limited sounds, the Apple II, which was very popular as well as very expensive, the Atari 800 and 400 - the arcade dream, with four voice sound and decent color but still well into the $500+ market for even the 400 without BASIC, and the newcomer IBM PC (which I think was delayed a few months since it's 1981 debut and then the first models were either a choice between cassette tape and floppy disk, as well as the established business standard S-100/CP/M microcomputer, which had a host of manufactures like Imsai, Kaypro, Osborne, etc.

What did the VIC have going for it besides a low price? A real keyboard, the other low-cost systems the Atari 400 and Timex Sinclair had membrane keyboard. Color graphics - as compared to its competing price point produce the Z81, Microsoft BASIC (virtually the same as PET's upgrade BASIC). Color (16 colors, thogh 8 was most video graphics could use with the other 8 accessible just via the background & border) and hi-res graphics, which includes a programmable character set (this made making good looking game possible even within the limited 3.5K of program RAM in the unexpanded VIC. Three voice sound (was not as good the Atari but much better then the PET). Easy expansion for memory (via cartridge) cassette, disk drive and modem among other things.

The peripherals also worked on setting lower price points, especially the Modem, up until the VIC MODEM modems were in the $300 range for the most basic 300 baud modem. the VIC MODEM debuted at $99, it was a decent 300 baud direct connect modem (via phone handset cord). Besides price a dubious distinction of the VIC and Modem was its prominent use by home computer hackers in the first home computer hacking stories in the early 1980's news.

Commodore did a service to the programming community in that their “OS” was pretty much open and documented by the community (previously many computers either did not document their hardware features to the public or actually put in in-chip DRM safeguards to keep profits in-company. This open access along with low price brought software and hardware development to those who had the interest and willingness but not the funds. Many a computer luminary can list the Commodore VIC as one of their first computers.

I myself bought my first computer, the VIC-20 in 1983 after graduating high school. With $200 I had a choice between the VIC with Datasette, and a programmers reference guide or just an Atari-400 without BASIC or any storage. I went with the VIC. 3.5K was not much memory but plenty if you utiilized a bit of creative development you could make some nice programs for it. At the time there was good 3rd party support for the VIC too including many magazines with type-in programs and how-to articles. (Compute!'s Gazzette for the VIC-20 and Commodore 64 started the same time I bought the VIC).

The VIC still is being suppored today by web forums and hardware - you can even connect the VIC-20 to the internet with CommodoreServer.com internet modem (software under development) play just about every game with the VIC-20 Mega Cartridge and store/transfer files easily via SD cards with latest Commodore 64/128/VIC compatible solid state drives like the uIEC/SD drive.

Thats enough rambling for now… Discuss.

~~LINKBACK~~ ~~DISCUSSION~~

2011/05/30 12:40

Blog Order and Updates

Looks like the BLOG order got scrambled a bit with the recent site updates, you can access the previous blog entries from the Index above.

Welcome to the new look for Port Commodore and CommVEx pages!

There has been some shuffling of content make things more sensible as the site contents grow, the Flash Attack, Commodore and classic computing stuff is now combined into a computing section. So if you have links to content on your site, verify that they still work.

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 17:14

Maker Faire 2010

This photo is from the Bay Area Maker Faire Held at the San Mateo Expo Center (a few miles south of San Francisco, CA for those unfamiliar). What a great place it is, over 600 displays of interesting people and stuff they make or things they do.

This was our third year attending, one of my Geek Recharge destinations (theres a topic for later).

Some tips if you plan to go to the Maker Faire:

  • Go for two days, there is just soo much stuff to see, the first day you will be doing a lot of gawking, and on the second you will have time to revisit the stuff you want to check out more.
  • Hydration is an issue, keep that in mind, there are no water fountains, so you have to buy expensive bottled water or drinks inside, the expo owners (not the Make people) restrict folks from bringing in thier own food and drink.
  • If you are coming in from a distance I suggest looking for a motel on El Camino Real (aka Hwy 82), there are some decent ones and the rates aren't all that bad, and you can catch a bus very easily…
  • And to get to the fair use the bus, this year each way was $2 each but no parking hassles to deal with.

Me with fellow Commodore fanatic, Jeri Ellsworth. I'm sporting a very pocketed safari vest to hold gadgets and stuff looks a little silly, but it's comfortably secure.

  • Bring a backpack or safari vest to carry stuff.
  • Don't forget to take pictures to show off all the cool stuff to your friends - this time I took video clips, but really needed to take longer ones than I did.
  • It is noisy, dont expect your companions to hear thir phones ringing.
  • The bathrooms at the two ends of the event site are never as busy as the ones in the middle.
  • Remember to sit and relax now and again, the food isnt bad, just expensive (and the west side has great shade/seating for eating and breaks.

Some Goodies from the Faire

  • Was looking for something I could possibly make a component case with, and I found Shape Lock which is a low melting point plastic. When you out it in water up to about 160 degrees F, it turns clear and you can shape it. Under 140 it turns into a opaque solid. Not sure it it will do what I need but it was worth the money for a sample, I'm sure I'll find some project or repair use for it.
  • A couple help you fix stuff resources - iFixit and WikiHow both offer a do it yourself resurce to fixing your own stuff.
  • The egg plotter by Egg-Bot which enables you to have precision drawings on cylindrical or spherical surfaces, plus it works with Linux and uses Inkscape drawings as a sourcefile, can't be much more cooler then that!
  • Posable stick figures by Posables, something I think kids young and old would get a kick messing with.

Theres so much more, check out the MakerFaire site for more examples and links.

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 16:50

A Couple Really Cool PHP Libraries

Create your own PDF documents programmatically with FPDF

Want to integrate existing PDFs into the PDFs you create? Then you also want to get the FPDI Libraries that extend FPDF so it can import in PDF pages.

…and a bonus for those who want to do barcodes with FPDF (this one is for code 3 of 9 but there are also other symbologies available.

Using these libraries are really easy and do an excellent job.

~~LINKBACK~~ ~~DISCUSSION~~

2011/04/17 16:50
Last modified:: 2020/11/22 08:33
   
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International