Page 1 of 1

Form method=post allowed in tags?

Posted: Tue Jan 16, 2007 1:48 pm
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

Re: Form method=post allowed in tags?

Posted: Tue Jan 16, 2007 2:48 pm
by cyberman
Have you tried $_SERVER['PHP_SELF']?

Re: Form method=post allowed in tags?

Posted: Tue Jan 16, 2007 2:53 pm
by Vidmantas K.
Doesn't work, the same situation when the browser goes back to index

Re: Form method=post allowed in tags?

Posted: Tue Jan 16, 2007 3:00 pm
by cyberman
Couriously. contact_form tag uses $_SERVER['PHP_SELF'] or $_SERVER['QUERY_STRING'] and it works ...

Re: Form method=post allowed in tags?

Posted: Tue Jan 16, 2007 4:52 pm
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