Best way to display a report AND add to database?

sinemac 30 Oct, 2007
I've used ChronoForms to create a form that collects some assessment data. Upon submit, I'd like the data to be added to the database AND have a report based on that data displayed. I'm not sure the best way to do this.

Currently, I have the php code for creating and displaying the report in an external php file that I call in an article using using the rdaddphp plugin. It works great - the data is passed to the script and the report is displayed just how I want it - BUT to get it to work, I set it to go to the script "on submit", so the data isn't saved to the database.

It seems to me there could be a few ways to go:
[list]
  • keep the external script as "on submit" and put code in the script to add the data to the database

  • change the external script to be a "redirect" after submit, and add code to pull the just submitted data from the database (I already tried it without, but it seems the $_POST variables are lost by the time the redirect happens, as the report comes out empty

  • some other way?
    [list]
  • is there code that could do it in the "before sending email" area?

  • or the after sending email section?

  • or the javascript section?
  • [/list][/list]

    In addition to not know which way would be best, I'm not sure how to go about doing any of them, as I don't know javascript, or how to access the database after submission, and be sure it gets the correct record.

    Suggestions?

    Thanks,
    Scott

    Post edited by: sinemac, at: 2007/10/30 00:16<br><br>Post edited by: sinemac, at: 2007/10/30 00:18
    Max_admin 31 Oct, 2007
    Hi sinemac,

    I agree, form data will need to be resubmitted someway, please google for fsockopen or curl, those are the methods I know which can help resubmitting the data to another URL, I wish you will do it๐Ÿ™‚

    Sincerely,

    Max
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    sinemac 31 Oct, 2007
    Thanks, Max. I'll see what I can discover, and will report back.
    This topic is locked and no more replies can be posted.