Page 1 of 2

The thread with no subject line...

Posted: Sat Feb 26, 2005 5:48 pm
by smpdawg
Of couse the post has a subject, just couldn't think of an appropriate subject line.

Since those of us in this area seem to be more seasoned PHP programmers and like to bounce ideas around I'd like to make this proposal. How about starting threads on a periodic basis that have a (hopefully) sustained discussion about common programming problems in PHP?

We could take a subject, talk about the common issues and propose a better way of solving the problem. Then as part of the discussion, we could make a sample implementation or implementations and refine it. The code that is generated could not only spark our discussions but could also help other people on the site.

If anyone else is interested, let's take a vote on the first topic.

BTW - If someone has already suggested this, my apologies and I'll be awaiting the flames. :D

Posted: Sun Feb 27, 2005 9:44 am
by McGruff
Securing scripts against hostile user input?

Posted: Sun Feb 27, 2005 11:14 am
by magicrobotmonkey
Maybe working with persistant objects? I hate having to repopulate things on every page - what a waste!

Posted: Sun Feb 27, 2005 12:08 pm
by smpdawg
There are also seem to be a lot of form related problems and that encompass what you have both suggested. But I am certainly not suggesting it before the others, it would be a big problem to tackle first.

I also wonder why there are few DB grids available, especially those that allowing sorting, editing, etc. Most projects that I work on end up requiring something like that and the closest that I have gotten is just writing a class to display nice and consistent looking tables. I have thought about just using http://activewidgets.com/ with a PHP wrapper but that doesn't address all my needs either.

Posted: Sun Feb 27, 2005 12:33 pm
by McGruff
What features are you looking for?

If you haven't seen this already, JPSPAN might be of interest for client side stuff.

Posted: Sun Feb 27, 2005 12:47 pm
by smpdawg
Was that directed to me?

Posted: Sun Feb 27, 2005 1:02 pm
by McGruff
Sorry yes - I was wondering what your feature list for a db grid would be.

Posted: Sun Feb 27, 2005 1:51 pm
by smpdawg
Here are some of my requirements.

Required:
Different types of databinding like CSV, XML, through an abstraction layer perhaps.
Completely CSS styled.
Sortable in both ascending and descending order.
Sort column can have a different color.
Draggable columns.
Resizable columns.
Show icons.
Can do replacements of ID fields to the pretty text. ie user_id mapped to user_name
Has to work in the major browsers.

Nice to have:
Right click context menus.
Sortable in the client without having to call back to the sever.
In place editing.
Column hiding.

Dream: :D
Collapsible rows that can show dissimilar information.

I'm sure there are more things but this is the basic stuff.

Posted: Sun Feb 27, 2005 3:40 pm
by smpdawg
I don't want to sidetrack this thread too much with my wish list...

So of the ideas bounced around (but not the grid) what one would we like to start with? Pick one and let's start a new thread and refine the idea and put out some code.

Posted: Sun Feb 27, 2005 3:49 pm
by feyd
I believe securing scripts could be of more use to lots of people, not just us "nuts" about this stuff. However both ideas would be good to talk about at some point.

So.. +1 for securing.

Posted: Sun Feb 27, 2005 4:10 pm
by smpdawg
Security is always a good thing. :D So if the vote continues this way, we could do security first and then persistence and they could lead into trying to building better forms.

Posted: Mon Feb 28, 2005 1:55 am
by smpdawg
I just broke down and wrote an object to generate the code to drive the grid from http://www.activewidgets.com.

It has row and column objects as well as row and column lists and a grid object. It generates the JavaScript to do a rudimentary grid like the one on the front page of their site. I am going to add tooltip and image support and make some refinements and post it back here when it is stable.

Posted: Mon Feb 28, 2005 5:10 am
by Weirdan
feyd wrote:I believe securing scripts could be of more use to lots of people, not just us "nuts" about this stuff. However both ideas would be good to talk about at some point.

So.. +1 for securing.
Some ideas could be borrowed from Security section of our internal Wiki, btw.

Posted: Mon Feb 28, 2005 8:23 am
by feyd
Ah yes, quite true, Weirdan.

Posted: Mon Feb 28, 2005 10:47 am
by McGruff
The grid idea does seem to be more of a js project but since it also has to interface with php domain objects, not exclusively so. I've never taken time out to learn some js so that could be interesting.

I don't want to push the decision one way or another. Maybe someone might even have other suggestions?