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
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]
[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
It occurs to me it might be easier to follow with an example:
http://www.headgutcheck.com/score_your_session
http://www.headgutcheck.com/score_your_session
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
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
This topic is locked and no more replies can be posted.