简体   繁体   English

无法使用Ajax发布到Osticket

[英]Cannot post to osticket with ajax

I am using osTicket on a subdomain of my domain. 我在域的子域上使用osTicket。 I have copied the open ticket form exactly from osTicket and placed it on a page on my main domain. 我完全从osTicket复制了打开的票证表单,并将其放在我的主域的页面上。 It posts through to the subdomain and works fine and the ticket is created. 它可以发布到子域,并且可以正常工作并创建票证。 If I try and do exactly the same post with ajax though I get no response. 如果我尝试使用ajax进行完全相同的发布,尽管没有任何反应。 It posts the variables exactly the same and finds the script but the script returns no output. 它发布的变量完全相同,并找到脚本,但脚本不返回任何输出。

Any help very much appreciated 任何帮助非常感谢

Thanks 谢谢

出于安全原因, 相同的原始策略可防止此情况。

I have got this working: if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) { define('CWD', $_SERVER['DOCUMENT_ROOT'] . "/support/" ); 我已经完成了这个工作:if(isset($ HTTP_POST_VARS ['action'])&&($ HTTP_POST_VARS ['action'] =='process')){define('CWD',$ _SERVER ['DOCUMENT_ROOT']。” / support /“); chdir( CWD ); chdir(CWD); require_once('client.inc.php'); require_once('client.inc.php');

    $inName    =  tep_db_prepare_input($HTTP_POST_VARS['name']);
    $inEmail   =  tep_db_prepare_input($HTTP_POST_VARS['email']);
    $inPhone   =  tep_db_prepare_input($HTTP_POST_VARS['phone']);
    $inTopic=1;
    $inSubject =  tep_db_prepare_input($HTTP_POST_VARS['subject']);
    $inMessage =  tep_db_prepare_input($HTTP_POST_VARS['message']);
    define('SOURCE','Web'); //Ticket source.
    require_once(INCLUDE_DIR.'class.ticket.php');
    $errors=ARRAY();
    $post_data['topicId']  =  $inTopic;
    $post_data['deptId']   =  0;
    $post_data['emailId']  =  0;
    $post_data['a']        =  'open';
    $post_data['draft_id'] =  50;
    $post_data['email']    = $inEmail;
    $post_data['name']     = $inName;
    $post_data['phone']    = $inPhone;
    $post_data['subject']  = $inSubject;
    $post_data['message']  = $inMessage;
    $ticket=Ticket::create($post_data, $errors, SOURCE);

// tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL')); // tep_redirect(tep_href_link(FILENAME_DEFAULT,``,'SSL'))); } }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM