Form method=post allowed in tags?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Vidmantas K.

Form method=post allowed in tags?

Post by Vidmantas K. »

Hello,

I'm trying to develop one quite simple wizard and put it into a tag for CMSMS. First page is with questions and I need to submit it using post method. But it simply doesn't work. Please tell me any known issues about this or where is a mistake?

Code: Select all

<?php
if(!$_POST && empty($option)) {
	# print form questions
	?>
	<form action="<?=$_SERVER["REQUEST_URI"]?>" method="post" name="survey">
	<table border="0" width="580px">
	<?php
	$info = $db->Execute("QUERY");
	$i = 1;
	while(!$info->EOF) {
		echo "some info right here";
		$i++;
		$info->MoveNext();
	}
	?>
	</table>
	<br /><a href="#" onclick="document.survey.submit();" class="seminar_button"><?=$show_results?></a> 
	</form>
	<?php
	
}


After submition browser returns to index page. The same if a href is set to $_SERVER["REQUEST_URI"]


Additional info:
CMS Made Simple 1.0.2 "Maui"
PHP Version 4.4.4



Thanks for any hints
cyberman

Re: Form method=post allowed in tags?

Post by cyberman »

Have you tried $_SERVER['PHP_SELF']?
Vidmantas K.

Re: Form method=post allowed in tags?

Post by Vidmantas K. »

Doesn't work, the same situation when the browser goes back to index
cyberman

Re: Form method=post allowed in tags?

Post by cyberman »

Couriously. contact_form tag uses $_SERVER['PHP_SELF'] or $_SERVER['QUERY_STRING'] and it works ...
Vidmantas K.

Re: Form method=post allowed in tags?

Post by Vidmantas K. »

Most interesting that when I've changed a href to

Code: Select all

<span onclick="document.survey.submit();" class="seminar_button" style="cursor: pointer;"><?=$show_results?></span>
form works correctly :-) Unbelievable
Locked

Return to “CMSMS Core”