Before I tell about the problem, I'd like to say I've been looking for this problem's solution whole day. I looked all similar questions in stackoverflow. Still no solution. My problem is that I've 5673 lines of code. So I can't paste all of the code here, at the end of a code I've "?>", and I get error like in title. If anyone can help me I'd be grateful. I know that this kind of issue would come up if any brackets aren't closed, or missing, but I've checked all line brackets, even double quotes. Let me paste my source code in a short, I've some codes that are written with "<?" or "<?=", at the moment of writing it was normal, don't know if it could cause the problem By the way my php version is 5.3.4. The last line is closing "<?" php at the beginning.
<?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>
<?
}
}
?>