Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

run php script on completion of a survey

More
7 years 10 months ago #136523 by Maverick87Shaka
Replied by Maverick87Shaka on topic run php script on completion of a survey
Hi to all,
Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).ready(function() {
 
    $.get('upload/templates/yourTemplateName/survey_end.php');
 
  });
 
</script>
it's this code valid?

I'm trying to run a custom .php script at the end of survey, but it's seams the survey doesn't execute my script on survey end.

My current version is: 2.50+ Build 160506
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 10 months ago #136526 by holch
Replied by holch on topic run php script on completion of a survey
Why not using the redirect feature of the End url feature and send the participant to your script?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
7 years 10 months ago #136528 by Maverick87Shaka
Replied by Maverick87Shaka on topic run php script on completion of a survey
mainly because I don't want to make the users "land" on this different page to run my script.
I don't want that users is able to view the "new" url
And if it's possible, my goal it's to run local script in a determinate path, not exposed on the public internet directory.
In my "vision" I would like to "launch" the execution of the .php script when users click on "finish" button, and show the standard limesurvey end page at the end of survey ( If it's possible I also like to serve the standard end page to the users without wait the execution of the other script )
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 10 months ago #136529 by holch
Replied by holch on topic run php script on completion of a survey
Well, then you need to wait if someone else has an idea. I can imagine that running your own PHP within LS is prevented somehow.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 10 months ago #136541 by tpartner
Replied by tpartner on topic run php script on completion of a survey
Try it with an absolute path to the script.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
7 years 10 months ago #136551 by Maverick87Shaka
Replied by Maverick87Shaka on topic run php script on completion of a survey

tpartner wrote: Try it with an absolute path to the script.

seams not work for me with absolute path, Now I'm tuning my script to know if it's possible to do what I need!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 10 months ago #136587 by DenisChenu
Replied by DenisChenu on topic run php script on completion of a survey
Hi,

afterSurveyComplete event is here to do that

But here : please don't answer to a topic 3 years after: the solution can be outdated.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose