Error: error xml response from server is invalid Start of error

Because of the script that performs the transition to a new page.

<?php /** * Совещания * */ define('XAJAX', true); require_once('../ePortal6/_config.inc'); if (!$app_acl->check('admin')) throw new ACLReadException(); $list = new AjaxList('l'); $list->add_column('Дата / Время', '10%'); $list->add_column('Совещание', '20%'); $list->add_column('Тип', '10%', null, 'center'); $list->add_column('Статус', '10%', null, 'center'); $list->add_column('Руководитель', '20%', null, 'center'); $list->add_column('Секретарь', '20%', null, 'center'); $list->add_column('Место', '10%', null, 'center'); $list->default_orderby = 'm.ds desc'; $list->state['rows'] = 20; if ( $app_acl->check('journal') ) { $list->add_action('print', 'Печать'); $list->action_callback = 'action_callback'; } $layout = new SearchListLayout(); $layout->DataArea_content = $list->__toString(); $layout->show_search_dialog = false; $layout->add_action('Расширенный поиск', "javascript:open_div_dialog('search_meet.php?objid=0', {callback_code:'AjaxList_command_l(null, null);'}); void(0);"); $layout->add_action('Печать', 'print.php'); $nav = new StandardNavigator(new NavigatorItem('НИИ', '/index.php'), new NavigatorItem('Совещания', '/monitoring/niimeet_list.php')); $xajax->processRequest(); echo html_start($nav) . $layout . html_end(); function app_html_head() { ?> <script type="text/javascript"> $(document).ready(function() { $('#filterl').focus(); }); </script> <?php } function AjaxList_callback_l(AjaxList $list, $req) { if (empty($_COOKIE['sql_update_meet'])) { $sql = "select m.id, m.title, mt.title as meet_type, ms.title as meet_status, (select CONCAT(fullname, IF(username IS NULL, '', CONCAT(' (', username, ')'))) from niistaff ns where ns.id = m.boss) as boss, (select CONCAT(fullname, IF(username IS NULL, '', CONCAT(' (', username, ')'))) from niistaff ns where ns.id = m.clerk) as clerk, m.room, m.ds from meetings m join meet_type mt on mt.id = m.meet_type join meet_status ms on ms.id = m.meet_status where m.deleted = 0 "; } else $sql = $_COOKIE['sql_update_meet']; $sd_text = $list->filter(); $sd_text_esc = db::escape_string($sd_text); if (!empty($sd_text_esc)) { $sql .= "and m.title like '%{$sd_text_esc}%'" . $list->order_by() . $list->limits(); } $rows = db_select_all($sql); echo $list->start(); foreach ($rows as $row) { echo $list->row_start($row['id']); echo $list->column($row['ds']); echo $list->column_start(); echo html_tag('a', array('href' => 'javascript:open_div_dialog(\'meeting_view.php?objid=' . $row['id'] . '\', {callback_code:\'AjaxList_command_l(null, null);\'}); void(0);'), $row['title']); echo $list->column_end(); echo $list->column($row['meet_type']); echo $list->column($row['meet_status']); echo $list->column($row['boss']); echo $list->column($row['clerk']); echo $list->column($row['room']); } echo $list->footer(); echo $list->end(); } function action_callback($action, $checkboxes, $objResponse, $list, $req) { global $app_acl; if (! $app_acl->check('staff')) throw new ACLUpdateException(); if ($action == 'print') { setcookie("checkboxes", serialize($checkboxes), time() + 600); echo '<script type="text/javascript"> window.location = "print.php" </script>'; } } ?> 

And this is where, in theory, should redirect:

 <?php require_once('../ePortal6/_config.inc'); $checkboxes = unserialize($_COOKIE['checkboxes']); $sql = "select m.id, m.title, mt.title as meet_type, ms.title as meet_status, (select CONCAT(fullname, IF(username IS NULL, '', CONCAT(' (', username, ')'))) from niistaff ns where ns.id = m.boss) as boss, (select CONCAT(fullname, IF(username IS NULL, '', CONCAT(' (', username, ')'))) from niistaff ns where ns.id = m.clerk) as clerk, m.room, m.ds from meetings m join meet_type mt on mt.id = m.meet_type join meet_status ms on ms.id = m.meet_status where m.deleted = 0"; if ($checkboxes!=0) { $sql .= " and m.id IN ("; foreach($checkboxes as $ch) { $ch = intval($ch); $sql .= $ch . ","; } $sql = substr($sql, 0, -1) . ")"; } $rows = db_select_all($sql); ?> <table border="1"> <col width="10%"> <col width="20%"> <col width="15%"> <col width="15%"> <col width="15%"> <col width="15%"> <col width="10%"> <?php echo "<tr> <th>Дата/время</th> <th>Тема совещания</th> <th>Тип совещания</th> <th>Статус</th> <th>Председатель</th> <th>Секретарь</th> <th>Место проведения</th> </tr>"; foreach ($rows as $row) { echo " <tr> <td>".$row['ds']."</td> <td>".$row['title']."</td> <td>".$row['meet_type']."</td> <td>".$row['meet_status']."</td> <td>".$row['boss']."</td> <td>".$row['clerk']."</td> <td>".$row['room']."</td> </tr>"; } ?> </table> <input class="button" type="submit" value="Печать" onclick="style.display='none';javascript: window.print();"></input> 
  • Do you have a question how to fix the error or what is the error? understanding the second quite easily solves the first. Obviously, the error is that XML is expected and in fact there is a piece of js before it. It is also obvious that if you simply give a similar piece of JS to the browser, then it will not work on its own and will remain text. Formulate your question more specifically. For the redirection using the PCP, the header("location: ...") , in case you suddenly try to do it in the form of js window.location - teran
  • And what do you actually want if you have js directly displayed between php functions (in the first piece of code in the middle). Remove it and most likely will work. - E_p
  • Is the header not used when there is no output at all? I have it. - Alex

0