Click to See Complete Forum and Search --> : Form data posting to same form php file.


Anon
10-25-2000, 05:54 PM
Hi.

I'm having problem with making a form post data to the same form document when clicking on the submit button.

Check out the code below, it works perfectly under Linux, but not in Win2k/IIS5 with PHP v. 4.0.3pl1.

<FORM METHOD="POST" ACTION="form.php4">
<INPUT TYPE="HIDDEN" NAME="countpost" VALUE="<?php print $countpost +1; ?>">

<?PHP
if ($countpost == 0) {
print "1";
} elseif ($countpost == 1) {
print "2";
}
?>

<INPUT TYPE="SUBMIT" NAME="Submit">
</FORM>

I do have these options defined as on:

register_globals
magic_quotes_gpc

I'd really appreciate any kind of feedback concerning this issue.


Thanks,
/Stefan Högdahl

Anon
10-25-2000, 07:23 PM
do you ever get the error:
"HTTP 405 - Resource not allowed
Internet Information Services"

im having issues with the same thing.
php/iis5

strangely i added a second form (yours)
and once it refreshes the page my post then works!

wierd stuff in the land of iis.
it will be nice once it works.

~ OK

Anon
10-25-2000, 08:32 PM
Hi,

I got this tip from a helpful user from the php mailing lists.

in the begging of the script put for every var:

$var=$HTTP_POST_VARS["var"];

Which will be in this case:

$countpost=$HTTP_POST_VARS["countpost"];


/Stefan Högdahl

Anon
10-26-2000, 02:13 PM
edit php.ini file and
set Register_globals to ON

should fix it.
then grab some wine, a girl,
and turn off the computer for the day.

~ ok