在我讲述这个问题之前,我想说我一整天都在寻找这个问题的解决方案。我在stackoverflow中查看了所有类似的问题。仍然没有解决方案我的问题是我有5673行代码。所以我不能在这里粘贴所有代码,在代码的末尾我“?>”,我得到的错误就像在标题中一样。如果有人能帮助我,我将不胜感激。我知道如果任何括号没有关闭或丢失,就会出现这种问题,但我检查了所有的行括号,甚至是双引号。让我简短地粘贴我的源代码,我的一些代码是用“< ?”或“< ? =”编写的,当时是写它是正常的,不知道是否可能导致问题 顺便说一句,我的PHP版本是5.3.4。最后一行是在开头关闭“< ?”php。
<?php
class vcrea {
// main class
public function form_createForm($params, $smarty_obj) {
global $db;
$LABEL = $params['LABEL'];
$STYLE_PREFIX = $params['STYLE_PREFIX'];
$sql = "
SELECT * FROM vcr1_forms_desc_form
WHERE DELETED = 0
AND (LABEL = '$LABEL' OR '' = '$LABEL')
AND (LANG = '" . $_SESSION['dil'] . "' OR '" . $_SESSION['site_settings']['MULTI_LANG_SUPPORT'] . "' != '1')
";
$rs = $db->execute($sql);
if (!$rs) {
JSAlert("Hata Olu��.! (FRM)");
exit;
}
$FORM_ID = $rs->fields['ID'];
$FORM_TITLE = $rs->fields['TITLE'];
$FORM_LABEL = $rs->fields['LABEL'];
$FORM_LANG = $rs->fields['LANG'];
$sql = "
SELECT * FROM vcr1_forms_desc_table
WHERE DELETED = 0
AND FORM_ID = '$FORM_ID'
ORDER BY RANK
";
$rs_tablo = $db->execute($sql);
if (!$rs_tablo) {
JSAlert("Hata Olu��.! (TAB)");
exit;
}
$tablo = Array();
while (!$rs_tablo->EOF) {
$tablo[$rs_tablo->fields['ID']] = $rs_tablo->fields;
$tablo[$rs_tablo->fields['ID']]['ROW_HEADERS'] = explode("###", "###" . $rs_tablo->fields['ROW_HEADERS']);
$tablo[$rs_tablo->fields['ID']]['COL_HEADERS'] = explode("###", "###" . $rs_tablo->fields['COL_HEADERS']);
$rs_tablo->movenext();
}
$data = Array();
$sql = "
SELECT * FROM vcr1_forms_desc_group
WHERE DELETED = 0
AND FORM_ID = '$FORM_ID'
ORDER BY RANK
";
$rs_grup = $db->execute($sql);
if (!$rs_grup) {
JSAlert("Hata Olu��.! (GRUP)");
exit;
}
while (!$rs_grup->EOF) {
$grup = Array();
$grup['ID'] = $rs_grup->fields['ID'];
$grup['TITLE'] = $rs_grup->fields['TITLE'];
$grup['ELEMENTS'] = Array();
$sql = "
SELECT * FROM vcr1_forms_desc_elements
WHERE DELETED = 0
AND FORM_ID = '$FORM_ID'
AND GROUP_ID = '" . $grup['ID'] . "'
ORDER BY RANK
";
$rs = $db->execute($sql);
if (!$rs) {
JSAlert("Hata Olu��.! (EL)");
exit;
}
while (!$rs->EOF) {
$rs->fields['SEPERATOR'] = html_entity_decode($rs->fields['SEPERATOR']);
$rs->fields['SEPERATOR'] = str_replace(Array('<', '>', '"'), Array('<', '>', '"'), stripslashes($rs->fields['SEPERATOR']));
if (!$rs->fields['TABLE_ID']) {
$rs->fields['MANDATORY_STAR'] = ($rs->fields['MANDATORY'] == '1') ? ' <sup><font color=red>*</font></sup>' : '';
$grup['ELEMENTS'][$rs->fields['ID']] = $rs->fields;
}
else {
if (!$grup['ELEMENTS']['TABLO_' . $rs->fields['TABLE_ID']]) {
$grup['ELEMENTS']['TABLO_' . $rs->fields['TABLE_ID']] = $tablo[$rs->fields['TABLE_ID']];
$grup['ELEMENTS']['TABLO_' . $rs->fields['TABLE_ID']]['ELEMENTS'] = Array();
}
$rs->fields['MANDATORY_STAR'] = ($rs->fields['MANDATORY'] == '1') ? ' <sup><font color=red>*</font></sup>' : '';
$grup['ELEMENTS']['TABLO_' . $rs->fields['TABLE_ID']]['ELEMENTS']['SATIR_' . $rs->fields['ROW']]['SUTUN_' . $rs->fields['COL']] = $rs->fields;
}
$rs->movenext();
}
$data[] = $grup;
$rs_grup->movenext();
}
?>
<form name="form_<?= $FORM_ID; ?>_<?= $FORM_LABEL; ?>" method="POST" action="?p=form_post" target="form_iframe_<?= $FORM_ID; ?>_<?= $FORM_LABEL; ?>">
<input type="hidden" name="FORM_ID" value="<?= $FORM_ID; ?>">
<input type="hidden" name="FORM_LANG" value="<?= $FORM_LANG; ?>">
<input type="hidden" name="FORM_LABEL" value="<?= $FORM_LABEL; ?>">
<input type="hidden" name="FORM_TITLE" value="<?= $FORM_TITLE; ?>">
<div class="<?= $STYLE_PREFIX; ?>_wrapper">
<div class="<?= $STYLE_PREFIX; ?>_form_title">
<?= $FORM_TITLE; ?>
</div>
<div class="<?= $STYLE_PREFIX; ?>_questions_area">
<?
foreach ($data as $grup) {
?>
<fieldset class="<?= $STYLE_PREFIX; ?>_fieldset">
<legend class="<?= $STYLE_PREFIX; ?>_group_title"><?= $grup['TITLE']; ?></legend>
<div class="<?= $STYLE_PREFIX; ?>_group_content">
<table cellpadding="3" cellspacing="0" border="0" class="<?= $STYLE_PREFIX; ?>_questions_table">
<?
foreach ($grup['ELEMENTS'] as $key => $ELEMENT) {
if (strpos($key, 'TABLO') === FALSE) {
?>
<tr>
<td class="<?= $STYLE_PREFIX; ?>_question_cell"><?= $ELEMENT['TITLE']; ?><?= $ELEMENT['MANDATORY_STAR']; ?></td>
<td class="<?= $STYLE_PREFIX; ?>_answer_cell">
<? $this->form_createElement($FORM_ID, $ELEMENT, $STYLE_PREFIX); ?>
</td>
</tr>
<?
}
else {
$tablo = $ELEMENT;
?>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0" class="<?= $STYLE_PREFIX; ?>_table">
<tr>
<td class="<?= $STYLE_PREFIX; ?>_table_title" colspan="<?= ($tablo['COL_COUNT'] + 1); ?>"><?= $tablo['TITLE']; ?></td>
</tr>
<tr>
<? for ($sutun = 0; $sutun < $tablo['COL_COUNT'] + 1; $sutun++) { ?>
<td class="<?= $STYLE_PREFIX; ?>_table_col_title"><?= $tablo['COL_HEADERS'][$sutun]; ?></td>
<? } ?>
</tr>
<? for ($satir = 1; $satir < $tablo['ROW_COUNT'] + 1; $satir++) { ?>
<tr>
<td class="<?= $STYLE_PREFIX; ?>_table_row_title"><?= $tablo['ROW_HEADERS'][$satir]; ?></td>
<? for ($sutun = 1; $sutun < $tablo['COL_COUNT'] + 1; $sutun++) { ?>
<td class="<?= $STYLE_PREFIX; ?>_table_answer_cell">
<? $this->form_createElement($FORM_ID, $tablo['ELEMENTS']['SATIR_' . $satir]['SUTUN_' . $sutun]); ?><?= $tablo['ELEMENTS']['SATIR_' . $satir]['SUTUN_' . $sutun]['MANDATORY_STAR']; ?>
</td>
<? } ?>
</tr>
<? } ?>
</table>
</td>
</tr>
<?
}
}
?>
</table>
</div>
</fieldset>
<?
}
?>
</div>
<div class="<?= $STYLE_PREFIX; ?>_submit_area">
<input type="submit" class="<?= $STYLE_PREFIX; ?>_input_submit" name="form_submitted" value="<?= $params['SUBMIT_BUTTON_TEXT']; ?>">
</div>
</div>
</form>
<iframe name="form_iframe_<?= $FORM_ID; ?>_<?= $FORM_LABEL; ?>" style="<? if (!$params['DEBUG']) { ?>display: none;<? } ?> width: 90%; height: 300px;" allowtransparency="true"></iframe>
<?
}
}
?>