Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
Hello. I have need to create new ticket from a PHP script. In hesk configuration there is enabled option to generate and needed captcha number http://staff.fundacjamiastasportu.pl/he ... .php?54451, so use this script is impossible for this.
What changes should I do in "index.php?a=add" script to allow submit taks from external PHP script without user interaction?
For example I may add some alternative secret key parameter in URL that hesk recvovery that this is accepted script.
Best regards
Sebastian
Submit a new task from extrenal script
Moderator: mkoch227
Re: Submit a new task from extrenal script
The easiest way would with no need to change anything would be to send an email and convert the email to ticket using email piping or pop3 fetching.
Modifying the submit_ticket.php is out of the scope of my support and might cause all kinds of problems, you should probably hire a PHP developer to help you with that instead.
Modifying the submit_ticket.php is out of the scope of my support and might cause all kinds of problems, you should probably hire a PHP developer to help you with that instead.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Submit a new task from extrenal script
Yes, this is the easiest way, but at least functional. For some rison I would use functional as from form submit.
Edit: It is possible to use submit_ticket.php to use with cURL query. Here You have list of modification that file:
[1]
Copy original file to renamed (for example submit_ticket_for_curl.php)
[2]
Section: '// Try to detect some simple SPAM bots'
Action: comment all this IF block
[3]
Section: '// Check anti-SPAM question'
Action: comment all IF block
[4]
Section: '// Check anti-SPAM image'
Action: comment all IF block
[5]
Section: IF block if ($hesk_settings['confirm_email'])
Action: comment all IF block
[6]
Section: '// Need to notify staff?'
Action: change IF rule adding ' AND $_POST['notify_owner'] == 1'
[7]
Section: '// Need to notify staff?'
Action: change ELSEIF rule adding ' AND $_POST['notify_owner'] == 1'
[8]
Section: Your script
Action: Create function something like this:
Of course You may add some yourself security mechanism, like secret code or IP filter
Edit: It is possible to use submit_ticket.php to use with cURL query. Here You have list of modification that file:
[1]
Copy original file to renamed (for example submit_ticket_for_curl.php)
[2]
Section: '// Try to detect some simple SPAM bots'
Action: comment all this IF block
[3]
Section: '// Check anti-SPAM question'
Action: comment all IF block
[4]
Section: '// Check anti-SPAM image'
Action: comment all IF block
[5]
Section: IF block if ($hesk_settings['confirm_email'])
Action: comment all IF block
[6]
Section: '// Need to notify staff?'
Action: change IF rule adding ' AND $_POST['notify_owner'] == 1'
[7]
Section: '// Need to notify staff?'
Action: change ELSEIF rule adding ' AND $_POST['notify_owner'] == 1'
[8]
Section: Your script
Action: Create function something like this:
Code: Select all
function sendHelpdeskTicket ($address='submit_ticket_for_curl.php', $name, $subject, $message, $category=1, $priority=3, $notify_owner=1, $email = 'admin@example.com') {
$arrPosts = Array (
'name' => $name,
'subject' => $subject,
'email' => $email,
'email2' => $email,
'category' => $category,
'priority' => $priority,
'message' => $message,
'notify_owner' => $notify_owner,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $address);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query ($arrPosts));
curl_exec($ch);
curl_close($ch);
}
Re: Submit a new task from extrenal script
Thanks for sharing your solution!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools