Re: [PHP-DB] Generating forms and form elements

2006-08-13 Thread Gerry D

Mark,

I am just catching up on mail, so you may have solved this already.

I came across AIOCP the other day (
http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=aiocp ) and
they store php code snippets in the database. You need to run the
install and have it create the database so you can start snooping
around. I am not sure I will use it, but there is lots to learn...

Gerry

On 6/20/06, Mark Fellowes [EMAIL PROTECTED] wrote:


Micah, Thanks for the reply.  I didn't see it earlier.  Also my apologies for 
the vagueness but right now things are somewhat vauge.
Let me try and explain better:

To start I'll paint a visual to explain it better.  Ultimately I know this will 
require additional tables (will get to that in a moment)

When the page loads, there is going to be a palette area where form fields of 
various types will be sitting.  They will not be in a form.  The form will sit in another 
part of the page in it's own div.  So to start the table all that should be generated 
into that palette area will be the form elements (selects, checkboxes, radio buttons, 
etc).  I'm thinking php will be used to pull the markup out of the table and into the 
palette.

Users can drag and drop form elements into the form.  They can edit the 
elements in there (i.e. length of field, label name, required field, etc). At 
that point the chosen elements (the ones now in the form) should be pumped back 
 into another table where a name column will save the form intact with all it's 
elements.

Hope this gives a better idea of what Im trying to acheive.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread dpgirago

Mark Fellows previously described:
 Hi, Hitting up the list for maybe a decent link(s) or pointers.
 I need to figure out how to generate forms and form elements from
 php code inside database tables. Hope this makes sense.  It's not
 a complete picture of what I need to do but the first step I'll need to
take.

Do you mean you want to store PHP code or HTML markup in the DB?

David

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Mark Fellowes
PHP code to generate HTML markup.   Or maybe just HTML code and then have the 
php generate it from the makrup in the table ?

Mark


-Original Message-
From: [EMAIL PROTECTED]
Sent: Tuesday, June 20, 2006 6:49 PM -07:00
To: Mark Fellowes [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Subject: [PHP-DB] Generating forms and form elements


Mark Fellows previously described:
 Hi, Hitting up the list for maybe a decent link(s) or pointers.
 I need to figure out how to generate forms and form elements from
 php code inside database tables. Hope this makes sense.  It's not
 a complete picture of what I need to do but the first step I'll need to
take.

Do you mean you want to store PHP code or HTML markup in the DB?

David

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread dpgirago

 Mark Fellows previously described:
 Hi, Hitting up the list for maybe a decent link(s) or pointers.
 I need to figure out how to generate forms and form elements from
 php code inside database tables. Hope this makes sense.  It's not
 a complete picture of what I need to do but the first step I'll need to
 take.

 Do you mean you want to store PHP code or HTML markup in the DB?
 David

 PHP code to generate HTML markup.   Or maybe just HTML code and then have
the php generate it from the markup in the table ?

 Mark

I've not done anything like this, but it doesn't make sense to me to store
PHP in the DB.
HTML makes much more sense. Maybe others have a different opinion...

David

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Mark Fellowes

Micah, Thanks for the reply.  I didn't see it earlier.  Also my apologies for 
the vagueness but right now things are somewhat vauge.  
Let me try and explain better:

To start I'll paint a visual to explain it better.  Ultimately I know this will 
require additional tables (will get to that in a moment)

When the page loads, there is going to be a palette area where form fields of 
various types will be sitting.  They will not be in a form.  The form will sit 
in another part of the page in it's own div.  So to start the table all that 
should be generated into that palette area will be the form elements (selects, 
checkboxes, radio buttons, etc).  I'm thinking php will be used to pull the 
markup out of the table and into the palette.  

Users can drag and drop form elements into the form.  They can edit the 
elements in there (i.e. length of field, label name, required field, etc). At 
that point the chosen elements (the ones now in the form) should be pumped back 
 into another table where a name column will save the form intact with all it's 
elements. 

Hope this gives a better idea of what Im trying to acheive.
Mark

-Original Message-
From: [EMAIL PROTECTED]
Sent: Tuesday, June 20, 2006 4:01 PM -07:00
To: Mark Fellowes [EMAIL PROTECTED]
Subject: [PHP-DB] Generating forms and form elements 
Hi Mark,

That's pretty vague, there's probably 1000 ways to do this. Are you just 
intending to store the HTML in a text field, or generate the form fields 
based on data so that the user can edit the data? Are you storing just 
data in the database, or the form structure? Also if it's structure, do 
you intend on storing formatting information, or just the form fields 
themselves.

If you sit down and draw up a detailed non-code plan, the solution would 
likely present itself.

-Micah


RE: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Bastien Koert


eval$code);

bastien


From: Mark Fellowes [EMAIL PROTECTED]
Reply-To: Mark Fellowes [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 15:37:10 GMT

Hi, Hitting up the list for maybe a decent link(s) or pointers.
I need to figure out how to generate forms and form elements from php code 
inside database tables. Hope this makes sense.  It's not a complete picture 
of what I need to do but the first step I'll need to take.


TIA
Mark


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Bastien Koert

whoops

eval ($code);

Bastien



From: Bastien Koert [EMAIL PROTECTED]
To: [EMAIL PROTECTED], php-db@lists.php.net
Subject: RE: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 16:44:22 -0400


eval$code);

bastien


From: Mark Fellowes [EMAIL PROTECTED]
Reply-To: Mark Fellowes [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 15:37:10 GMT

Hi, Hitting up the list for maybe a decent link(s) or pointers.
I need to figure out how to generate forms and form elements from php code 
inside database tables. Hope this makes sense.  It's not a complete 
picture of what I need to do but the first step I'll need to take.


TIA
Mark


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Stut

Bastien Koert wrote:

whoops

eval ($code);


Someone relatively famous[1] once said If eval is the answer then 
you're asking the wrong question.


The eval function is dangerous. Extremely dangerous. From every point of 
view there is. If there's another way to do what you're doing (and there 
almost always is), do that instead. In this case a description of the 
form would be a better thing to store in the DB rather than the code to 
generate it.


-Stut

[1] Rasmus, a while back, can't recall when, but it stuck in my mind


Bastien



From: Bastien Koert [EMAIL PROTECTED]
To: [EMAIL PROTECTED], php-db@lists.php.net
Subject: RE: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 16:44:22 -0400


eval$code);

bastien


From: Mark Fellowes [EMAIL PROTECTED]
Reply-To: Mark Fellowes [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 15:37:10 GMT

Hi, Hitting up the list for maybe a decent link(s) or pointers.
I need to figure out how to generate forms and form elements from php 
code inside database tables. Hope this makes sense.  It's not a 
complete picture of what I need to do but the first step I'll need to 
take.


TIA
Mark


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Bastien Koert


Not commenting on the appropriateness or security of the eval function. 
Merely offering a possible path. It is up to the OP to decide if that 
solution is the correct one.


B


From: Stut [EMAIL PROTECTED]
To: Bastien Koert [EMAIL PROTECTED]
CC: [EMAIL PROTECTED],  php-db@lists.php.net
Subject: Re: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 22:09:06 +0100

Bastien Koert wrote:

whoops

eval ($code);


Someone relatively famous[1] once said If eval is the answer then you're 
asking the wrong question.


The eval function is dangerous. Extremely dangerous. From every point of 
view there is. If there's another way to do what you're doing (and there 
almost always is), do that instead. In this case a description of the form 
would be a better thing to store in the DB rather than the code to generate 
it.


-Stut

[1] Rasmus, a while back, can't recall when, but it stuck in my mind


Bastien



From: Bastien Koert [EMAIL PROTECTED]
To: [EMAIL PROTECTED], php-db@lists.php.net
Subject: RE: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 16:44:22 -0400


eval$code);

bastien


From: Mark Fellowes [EMAIL PROTECTED]
Reply-To: Mark Fellowes [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Generating forms and form elements
Date: Tue, 20 Jun 2006 15:37:10 GMT

Hi, Hitting up the list for maybe a decent link(s) or pointers.
I need to figure out how to generate forms and form elements from php 
code inside database tables. Hope this makes sense.  It's not a complete 
picture of what I need to do but the first step I'll need to take.


TIA
Mark


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Stut

Bastien Koert wrote:
Not commenting on the appropriateness or security of the eval function. 
Merely offering a possible path. It is up to the OP to decide if that 
solution is the correct one.


I would accept that if you'd mentioned, or at least hinted at the issues 
that need to be addressed when using eval. You didn't so I thought it 
needed to be pointed out. I think we, as a community, have a 
responsibility to point out the potential security and stability 
pitfalls of the possible solutions we provide. But that's just me.


-Stut

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Micah Stevens


Hi Mark,

No problem!

There as always are many ways to accomplish this, and this sounds like 
this will be largely an exercise in Javascript, but on the PHP/SQL side 
you'll just need to design a table where rows correspond to information 
that pertains to the whole form (username or ID, title, stuff like that) 
and then a second table that corresponds to form fields for the form, 
and are linked via an ID field. I do a similar thing for some shopping 
cart software that allows the administrator to build custom forms to 
collect information for particular items for sale. It works pretty well. 
Is there something in particular you're struggling with or does this help?


The hard part I think will be associating the javascript drag/drop 
events with information storage in the database. This to me would work 
well with a small javascript routine that will upon dropping call 
XMLRequest to a server side script that will update the table 
immediatly. Then you don't have to mess with some grotesque hidden form 
madness to keep track of what the user wants.


-Micah


Mark Fellowes wrote:



Micah, Thanks for the reply. I didn't see it earlier. Also my 
apologies for the vagueness but right now things are somewhat vauge.


Let me try and explain better:


To start I'll paint a visual to explain it better. Ultimately I know 
this will require additional tables (will get to that in a moment)



When the page loads, there is going to be a palette area where form 
fields of various types will be sitting. They will not be in a form. 
The form will sit in another part of the page in it's own div. So to 
start the table all that should be generated into that palette area 
will be the form elements (selects, checkboxes, radio buttons, etc). 
I'm thinking php will be used to pull the markup out of the table and 
into the palette.



Users can drag and drop form elements into the form. They can edit the 
elements in there (i.e. length of field, label name, required field, 
etc). At that point the chosen elements (the ones now in the form) 
should be pumped back into another table where a name column will save 
the form intact with all it's elements.



Hope this gives a better idea of what Im trying to acheive.

Mark


-Original Message-

From: [EMAIL PROTECTED]

Sent: Tuesday, June 20, 2006 4:01 PM -07:00

To: Mark Fellowes [EMAIL PROTECTED]

Subject: [PHP-DB] Generating forms and form elements

Hi Mark,


That's pretty vague, there's probably 1000 ways to do this. Are you just

intending to store the HTML in a text field, or generate the form fields

based on data so that the user can edit the data? Are you storing just

data in the database, or the form structure? Also if it's structure, do

you intend on storing formatting information, or just the form fields

themselves.


If you sit down and draw up a detailed non-code plan, the solution would

likely present itself.


-Micah

!DSPAM:4498548e259778165356420! 




Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Stut

Micah Stevens wrote:

Stut wrote:

Bastien Koert wrote:
Not commenting on the appropriateness or security of the eval 
function. Merely offering a possible path. It is up to the OP to 
decide if that solution is the correct one.


I would accept that if you'd mentioned, or at least hinted at the 
issues that need to be addressed when using eval. You didn't so I 
thought it needed to be pointed out. I think we, as a community, have 
a responsibility to point out the potential security and stability 
pitfalls of the possible solutions we provide. But that's just me.


Last time I handed someone a rope, I didn't tell them to not hang 
themselves. :)


Then you assumed they knew what a rope was and that it's generally a bad 
idea to use it to suspend themselves in the air by their neck. Likewise 
you assumed the OP knew that eval was dangerous.


-Stut

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Micah Stevens

Stut wrote:

Micah Stevens wrote:

Stut wrote:

Bastien Koert wrote:
Not commenting on the appropriateness or security of the eval 
function. Merely offering a possible path. It is up to the OP to 
decide if that solution is the correct one.


I would accept that if you'd mentioned, or at least hinted at the 
issues that need to be addressed when using eval. You didn't so I 
thought it needed to be pointed out. I think we, as a community, 
have a responsibility to point out the potential security and 
stability pitfalls of the possible solutions we provide. But that's 
just me.


Last time I handed someone a rope, I didn't tell them to not hang 
themselves. :)


Then you assumed they knew what a rope was and that it's generally a 
bad idea to use it to suspend themselves in the air by their neck. 
Likewise you assumed the OP knew that eval was dangerous.


-Stut

Exactly.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php