Hello, I'm new to Drupal, and after looking FAPI documentation there are some kind of things that are not clear to me. Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table??? How can I create a view where I can show all the data that has been submitted??? Thanks in advance
What is great about Drupal is that when you create a content type, even using CCK module and defining extra custom fields, everything is automagically persisted in the database and may be retrieved as nodes. You don't have to worry about that. And, Drupal has a contributed module which is really practically part of Drupal itself (no-one develops any serious sites without using it and CCK): the Views module, which is a query generator so you don't have to use SQL to list your nodes. There is a powerful graphical interface which allows you to create your query on the fly and even shows you a preview of the list you will be getting. The views module (http://drupal.org/project/views) also allows you to create as many displays of the view (Page/Block/RSS etc.) as you like. That's why everyone is flocking to Drupal! Victor Kane http://awebfactory.com.ar On Thu, Jul 30, 2009 at 11:03 AM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello,
I'm new to Drupal, and after looking FAPI documentation there are some kind of things that are not clear to me.
Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
How can I create a view where I can show all the data that has been submitted???
Thanks in advance
Hello Victor, My problem is, after submitting a form, post values are automatically persisted by Drupal or have I to do myself?? Thanks a lot 2009/7/30 Victor Kane <victorkane@gmail.com>
What is great about Drupal is that when you create a content type, even using CCK module and defining extra custom fields, everything is automagically persisted in the database and may be retrieved as nodes. You don't have to worry about that.
And, Drupal has a contributed module which is really practically part of Drupal itself (no-one develops any serious sites without using it and CCK): the Views module, which is a query generator so you don't have to use SQL to list your nodes. There is a powerful graphical interface which allows you to create your query on the fly and even shows you a preview of the list you will be getting.
The views module (http://drupal.org/project/views) also allows you to create as many displays of the view (Page/Block/RSS etc.) as you like.
That's why everyone is flocking to Drupal!
Victor Kane http://awebfactory.com.ar
On Thu, Jul 30, 2009 at 11:03 AM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello,
I'm new to Drupal, and after looking FAPI documentation there are some kind of things that are not clear to me.
Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
How can I create a view where I can show all the data that has been submitted???
Thanks in advance
The data will be sent to your submit handling function - if you wish to persist the data, you can either manually store it in a db table, or you could programatically create a node containing the data. See the section "Submitting Forms" in http://api.drupal.org/api/file/developer/topics/forms_api.html/6 The short answer is yes, you have to do it yourself :) Best, William On Thu, Jul 30, 2009 at 10:33 AM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello Victor,
My problem is, after submitting a form, post values are automatically persisted by Drupal or have I to do myself??
Thanks a lot
2009/7/30 Victor Kane <victorkane@gmail.com>
What is great about Drupal is that when you create a content type, even
using CCK module and defining extra custom fields, everything is automagically persisted in the database and may be retrieved as nodes. You don't have to worry about that.
And, Drupal has a contributed module which is really practically part of Drupal itself (no-one develops any serious sites without using it and CCK): the Views module, which is a query generator so you don't have to use SQL to list your nodes. There is a powerful graphical interface which allows you to create your query on the fly and even shows you a preview of the list you will be getting.
The views module (http://drupal.org/project/views) also allows you to create as many displays of the view (Page/Block/RSS etc.) as you like.
That's why everyone is flocking to Drupal!
Victor Kane http://awebfactory.com.ar
On Thu, Jul 30, 2009 at 11:03 AM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello,
I'm new to Drupal, and after looking FAPI documentation there are some kind of things that are not clear to me.
Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
How can I create a view where I can show all the data that has been submitted???
Thanks in advance
Ah, it was not clear to me that Salvador was talking about a custom form... On Thu, Jul 30, 2009 at 12:38 PM, William Smith <william.darren@gmail.com>wrote:
The data will be sent to your submit handling function - if you wish to persist the data, you can either manually store it in a db table, or you could programatically create a node containing the data. See the section "Submitting Forms" in http://api.drupal.org/api/file/developer/topics/forms_api.html/6
The short answer is yes, you have to do it yourself :)
Best, William
On Thu, Jul 30, 2009 at 10:33 AM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello Victor,
My problem is, after submitting a form, post values are automatically persisted by Drupal or have I to do myself??
Thanks a lot
2009/7/30 Victor Kane <victorkane@gmail.com>
What is great about Drupal is that when you create a content type, even
using CCK module and defining extra custom fields, everything is automagically persisted in the database and may be retrieved as nodes. You don't have to worry about that.
And, Drupal has a contributed module which is really practically part of Drupal itself (no-one develops any serious sites without using it and CCK): the Views module, which is a query generator so you don't have to use SQL to list your nodes. There is a powerful graphical interface which allows you to create your query on the fly and even shows you a preview of the list you will be getting.
The views module (http://drupal.org/project/views) also allows you to create as many displays of the view (Page/Block/RSS etc.) as you like.
That's why everyone is flocking to Drupal!
Victor Kane http://awebfactory.com.ar
On Thu, Jul 30, 2009 at 11:03 AM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello,
I'm new to Drupal, and after looking FAPI documentation there are some kind of things that are not clear to me.
Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
How can I create a view where I can show all the data that has been submitted???
Thanks in advance
Automatic! You can see that, because, when you go to Add content, then fill in the fields, and click Submit, you actually see the resulting node (the nid (node id) is in the URL too). This is actually a page rendered by reading the new node from the database Victor On Thu, Jul 30, 2009 at 12:33 PM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello Victor,
My problem is, after submitting a form, post values are automatically persisted by Drupal or have I to do myself??
Thanks a lot
2009/7/30 Victor Kane <victorkane@gmail.com>
What is great about Drupal is that when you create a content type, even
using CCK module and defining extra custom fields, everything is automagically persisted in the database and may be retrieved as nodes. You don't have to worry about that.
And, Drupal has a contributed module which is really practically part of Drupal itself (no-one develops any serious sites without using it and CCK): the Views module, which is a query generator so you don't have to use SQL to list your nodes. There is a powerful graphical interface which allows you to create your query on the fly and even shows you a preview of the list you will be getting.
The views module (http://drupal.org/project/views) also allows you to create as many displays of the view (Page/Block/RSS etc.) as you like.
That's why everyone is flocking to Drupal!
Victor Kane http://awebfactory.com.ar
On Thu, Jul 30, 2009 at 11:03 AM, Salvador Benimeli <salbefe@gmail.com>wrote:
Hello,
I'm new to Drupal, and after looking FAPI documentation there are some kind of things that are not clear to me.
Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
How can I create a view where I can show all the data that has been submitted???
Thanks in advance
Hello Sam, I have made a form using FAPI. That form is for subscribe users for participate in a race. Once a user is subscribed I have to send a email to that user with race information, etc. Once thing more, users have to paid for subscribing in that race. After submitting that form, they have five days to paid. If a user do not paid in that period it should be removed. That's what I'm doing. I'm not sure If it would be easier with CCK and views or with FAPI or I can't do that with drupal Thanks a lot 2009/7/30 Sam Tresler <sam@treslerdesigns.com>
The short answer is yes, you have to do it yourself :)
Victor Kane wrote:
Automatic!
Wow. So, what are you doing, Salvador, so that we might better answer your question? Are you writing a module?
-Sam
On 30-Jul-09, at 12:37 PM, Salvador Benimeli wrote:
I'm not sure If it would be easier with CCK and views or with FAPI or I can't do that with drupal
A few options: - http://drupal.org/project/webform is great for creating forms which send off emails. You'd still have to write something to automatically mark and remove unpaid participants. - http://drupal.org/project/signup and related modules may also do what you need, possibly without any coding at all (see the list of modules on the page) - You could probably do the whole ecommerce flow (with online payment) with ubercart + cck + views + workflow modules. - You could write a form yourself as it sounds like you're all ready doing, with a second form for admins to mark payment (assuming that's your plan). Your goals sound simple enough that if you want to learn module development, this would be a good way to go. You'll probably want to read: http://api.drupal.org/api/file/developer/topics/forms_api.html/6 (implementing the validate and submit functions for your forms, to answer your original question) http://api.drupal.org/api/function/hook_cron (for expiring unpaid entries) http://api.drupal.org/api/function/drupal_mail (don't call mail() directly) http://api.drupal.org/api/function/check_plain (to ensure your site doesn't get hacked via XSS - just as important as db_query() with placeholders) Depending on how much time you have, it's probably worth playing around with a few of these options to see what fits best. HTH, --Andrew
Thank you very much for your responses, I think I will do using FAPI and building two forms. 2009/7/30 Andrew Berry <andrewberry@sentex.net>
On 30-Jul-09, at 12:37 PM, Salvador Benimeli wrote:
I'm not sure If it would be easier with CCK and views or with FAPI or I
can't do that with drupal
A few options:
- http://drupal.org/project/webform is great for creating forms which send off emails. You'd still have to write something to automatically mark and remove unpaid participants.
- http://drupal.org/project/signup and related modules may also do what you need, possibly without any coding at all (see the list of modules on the page)
- You could probably do the whole ecommerce flow (with online payment) with ubercart + cck + views + workflow modules.
- You could write a form yourself as it sounds like you're all ready doing, with a second form for admins to mark payment (assuming that's your plan). Your goals sound simple enough that if you want to learn module development, this would be a good way to go. You'll probably want to read:
http://api.drupal.org/api/file/developer/topics/forms_api.html/6(implementin... the validate and submit functions for your forms, to answer your original question) http://api.drupal.org/api/function/hook_cron (for expiring unpaid entries) http://api.drupal.org/api/function/drupal_mail (don't call mail() directly) http://api.drupal.org/api/function/check_plain (to ensure your site doesn't get hacked via XSS - just as important as db_query() with placeholders)
Depending on how much time you have, it's probably worth playing around with a few of these options to see what fits best.
HTH, --Andrew
Quoting Salvador Benimeli <salbefe@gmail.com>:
Hello Sam,
I have made a form using FAPI. That form is for subscribe users for participate in a race. Once a user is subscribed I have to send a email to that user with race information, etc. Once thing more, users have to paid for subscribing in that race. After submitting that form, they have five days to paid. If a user do not paid in that period it should be removed. That's what I'm doing. I'm not sure If it would be easier with CCK and views or with FAPI or I can't do that with drupal
I would use FAPI with hook_form_alter. There may be modules already written that will allow you to manage your subscriptions to races. I would use one of the online services such as PayPal to accept the dollar amount for the subscription. You need to decide if you want to retain the user after the race event or expire them. You need to decide if one user can apply to more than one race or if it is one user to one race. -- Earnie -- http://r-feed.com/ -- http://for-my-kids.com/ -- http://www.4offer.biz/ -- http://give-me-an-offer.com/
Frankly, I take this as an insult. Most of my sites do NOT use Views, and fewer use CCK. So you've just said that my sites are not serious. Yes, CCK and Views are are great when they are needed (I have one site that is nothing but CCK/Views), but they simply are not always needed. If I only need one or two "custom" queries, I am not going to pay the overhead of Views. If I have more complex needs, yes, I will use it. -- Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. -------------- Original message from Victor Kane: -------------- Drupal has a contributed module which is really practically part of Drupal itself (no-one develops any serious sites without using it and CCK): the Views module,
Sorry, Nancy, I didn't mean to belittle sites that don't use Views. I should have said any serious Drupal site containing business objects and wishing to avoid tying oneself down to soon-to-be-dated SQL. Cheers, Victor On Thu, Jul 30, 2009 at 12:37 PM, <nan_wich@bellsouth.net> wrote:
Frankly, I take this as an insult. Most of my sites do NOT use Views, and fewer use CCK. So you've just said that my sites are not serious.
Yes, CCK and Views are are great when they are needed (I have one site that is nothing but CCK/Views), but they simply are not always needed. If I only need one or two "custom" queries, I am not going to pay the overhead of Views. If I have more complex needs, yes, I will use it.
-- Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
-------------- Original message from Victor Kane: --------------
Drupal has a contributed module which is really practically part of Drupal itself (no-one develops any serious sites without using it and CCK): the Views module,
If you are creating your own forms for data input, then, yes, you are responsible for managing it. -- Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. -------------- Original message from Salvador Benimeli: -------------- Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
One question more now I know I have to manage myself form post data. If I persist the data on a custom table inside my database and later I want to do something with that data...what should I do? For example, once the data is inside a table on a database I would like to create a 'view' as a list from it. As I read, I can't use views module because that data is not a node. How can I do "custom" queries and then display it?? Thanks a lot 2009/7/30 <nan_wich@bellsouth.net>
If you are creating your own forms for data input, then, yes, you are responsible for managing it.
-- Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
-------------- Original message from Salvador Benimeli: --------------
Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
For that reason, the drupal way would be to try to use CCK with business objects and if you use custom forms for some reason, persist that data to a node, as described in another answer. These are the services offered by the Drupal Framework. Victor On Thu, Jul 30, 2009 at 1:13 PM, Salvador Benimeli <salbefe@gmail.com>wrote:
One question more now I know I have to manage myself form post data. If I persist the data on a custom table inside my database and later I want to do something with that data...what should I do? For example, once the data is inside a table on a database I would like to create a 'view' as a list from it. As I read, I can't use views module because that data is not a node. How can I do "custom" queries and then display it??
Thanks a lot
2009/7/30 <nan_wich@bellsouth.net>
If you are creating your own forms for data input, then, yes, you are responsible for managing it.
-- Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
-------------- Original message from Salvador Benimeli: --------------
Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
If the data is extra stuff for a node (i.e. beyond a title and body), then yes, it is a node, but your node module still needs to let Views know about the extra fields and how to get to them. As Victor keeps harping, CCK does this for you. -- Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. -------------- Original message from Salvador Benimeli <salbefe@gmail.com>: -------------- One question more now I know I have to manage myself form post data. If I persist the data on a custom table inside my database and later I want to do something with that data...what should I do? For example, once the data is inside a table on a database I would like to create a 'view' as a list from it. As I read, I can't use views module because that data is not a node. How can I do "custom" queries and then display it?? Thanks a lot 2009/7/30 <nan_wich@bellsouth.net> If you are creating your own forms for data input, then, yes, you are responsible for managing it. -- Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. -------------- Original message from Salvador Benimeli: -------------- Where go the data once the form has been submitted?? The data submitted on a form is stored as a node or other kind of content or have I to create a table on the database and storing post values inside that table???
participants (7)
-
Andrew Berry -
Earnie Boyd -
nan_wich@bellsouth.net -
Salvador Benimeli -
Sam Tresler -
Victor Kane -
William Smith