Page 1 of 1
Can I run a custom script/URL after ticket is submitted
Posted: Wed Oct 24, 2012 5:02 pm
by curiosus
Can I run a custom script/URL after ticket is submitted?
For example if someone submits a ticket, a custom PHP script will get executed.
If this is currently possible how do I do it?
If not, I hope you can add it as feature. Thanks.
Re: Can I run a custom script/URL after ticket is submitted
Posted: Wed Oct 24, 2012 7:57 pm
by Klemen
You would have to modify source code of submit_ticket.php file to do that and I'm afraid there are so many possible options and ways of doing it (you didn't say exactly what you wish to achieve) it's not planned for future versions at the moment,
Re: Can I run a custom script/URL after ticket is submitted
Posted: Wed Oct 24, 2012 9:55 pm
by curiosus
Thank you.
Well basically, what I want to achieve was pretty much run an external URL (silently without interfering with the user experience) after a new ticket is successfully submitted.
Guess i'll play around with submit_ticket.php but if you have a tip on how can I best achieve this that'll be awesome thanks

Re: Can I run a custom script/URL after ticket is submitted
Posted: Thu Oct 25, 2012 8:29 am
by Klemen
There are many ways of doing it, depending on what you need.
For example one way is to include a hidden image with the link to your URL on the page that shows after a ticket is submitted.
Another way is to include PHP code to do a PHP POST/GET to an URL of your choice before the "ticket submitted" page shows. You should be able to find code samples in Google.
Re: Can I run a custom script/URL after ticket is submitted
Posted: Thu Oct 25, 2012 5:48 pm
by curiosus
We'll play around with it, thanks!
Re: Can I run a custom script/URL after ticket is submitted
Posted: Fri Oct 26, 2012 2:24 pm
by curiosus
For anyone interested, I used:
Code: Select all
file_get_contents('http://example.com/test.php');
inside
submit_ticket.php just above:
Code: Select all
// Print header
require_once(HESK_PATH . 'inc/header.inc.php');