 |
|
 |
|
Next: IIS for XP Home?
|
| Author |
Message |
External

Since: Nov 04, 2003 Posts: 6
|
(Msg. 1) Posted: Tue Nov 04, 2003 8:23 am
Post subject: How to stop POST variables passing between pages Archived from groups: microsoft>public>inetserver>iis (more info?)
|
|
|
Hi,
I am having a problem using php on IIS.
A user fills in a form and submits to my script.
After processing the script then calls itself again using
a rediret header and passes on different variables via the
URL. No POST variables are sent.
When the script runs for the second time it appears to
have been passed the previous POST variables.
Using the same version of PHP and script on an apache
server does not have the problem. Also I am NOT using
sessions and have already tried disabling that setting in
IIS.
I have also noted that on apache the redirected url
appears on the address bar while on IIS I only get the url
from when the script was first called.
Is this expected behaviour of IIS, and if so is their a
way round it so that it only passes the variables I want
into a script.
Martin >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
External

Since: Aug 25, 2003 Posts: 2419
|
(Msg. 2) Posted: Tue Nov 04, 2003 4:09 pm
Post subject: Re: How to stop POST variables passing between pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
So basically, the page first POSTs to itself, then Redirects to itself with
a URL+QueryString?
Anyway, POST variables cannot be sent on the Redirect because 302 Redirects
do not include entity body, which is where the POST variables are stored.
What IIS version are you referring to.
I tried on IIS5 (W2KSP4) to create a ASP page which POSTs to itself, and on
the POST, send a Redirect to itself with URL+QueryString. I verified that
it did receive the QueryString of the redirect, and not the POST.
So, this does not seem to be an IIS issue but rather something specific to
PHP or Browser.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Martin Harrison" <anonymous DeleteThis @discussions.microsoft.com> wrote in message
news:0b3d01c3a2d6$c4ffb7e0$a501280a@phx.gbl...
Hi,
I am having a problem using php on IIS.
A user fills in a form and submits to my script.
After processing the script then calls itself again using
a rediret header and passes on different variables via the
URL. No POST variables are sent.
When the script runs for the second time it appears to
have been passed the previous POST variables.
Using the same version of PHP and script on an apache
server does not have the problem. Also I am NOT using
sessions and have already tried disabling that setting in
IIS.
I have also noted that on apache the redirected url
appears on the address bar while on IIS I only get the url
from when the script was first called.
Is this expected behaviour of IIS, and if so is their a
way round it so that it only passes the variables I want
into a script.
Martin >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
External

Since: Nov 04, 2003 Posts: 6
|
(Msg. 3) Posted: Wed Nov 05, 2003 8:24 am
Post subject: Re: How to stop POST variables passing between pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Im using Win2kSP4 and IIS5
The script generates a page with form on it
this calls the script again but with with POST (form data)
and url+query string (Action and display options)
The script then processes the form (updates a database)
then calls its self again (via php header command)but with
just URL+query string (and does the impossible of
retaining teh post data)
I have used the same build of on php on apache and all is
ok
I have also used IE5 & 6 and get the same results, so im
convinced its something to do with the server rather than
browser, and find it hard to see how php would call its
self seeing im using the http header and it should be
being called from the browser/web server.
One other point - at teh begging of my script I convert
the post & url data that im expecting into varibles, but I
would expect them to all be cleared when the script exits -
indeed I tried unsetting them and it made no difference.
Martin
>-----Original Message-----
>So basically, the page first POSTs to itself, then
Redirects to itself with
>a URL+QueryString?
>
>Anyway, POST variables cannot be sent on the Redirect
because 302 Redirects
>do not include entity body, which is where the POST
variables are stored.
>
>What IIS version are you referring to.
>
>I tried on IIS5 (W2KSP4) to create a ASP page which POSTs
to itself, and on
>the POST, send a Redirect to itself with
URL+QueryString. I verified that
>it did receive the QueryString of the redirect, and not
the POST.
>
>So, this does not seem to be an IIS issue but rather
something specific to
>PHP or Browser.
>
>--
>//David
>IIS
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>//
>"Martin Harrison" <anonymous RemoveThis @discussions.microsoft.com>
wrote in message
>news:0b3d01c3a2d6$c4ffb7e0$a501280a@phx.gbl...
>Hi,
>
>I am having a problem using php on IIS.
>A user fills in a form and submits to my script.
>After processing the script then calls itself again using
>a rediret header and passes on different variables via the
>URL. No POST variables are sent.
>
>When the script runs for the second time it appears to
>have been passed the previous POST variables.
>
>Using the same version of PHP and script on an apache
>server does not have the problem. Also I am NOT using
>sessions and have already tried disabling that setting in
>IIS.
>
>I have also noted that on apache the redirected url
>appears on the address bar while on IIS I only get the url
>from when the script was first called.
>
>Is this expected behaviour of IIS, and if so is their a
>way round it so that it only passes the variables I want
>into a script.
>
>Martin
>
>
>.
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
External

Since: Aug 25, 2003 Posts: 2419
|
(Msg. 4) Posted: Wed Nov 05, 2003 4:27 pm
Post subject: Re: How to stop POST variables passing between pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
>>Anyway, POST variables cannot be sent
>>on the Redirect because 302 Redirects
>>do not include entity body, which is
>>where the POST variables are stored.
>The script then processes the form (updates a database)
>then calls its self again (via php header command)but with
>just URL+query string (and does the impossible of
>retaining teh post data)
If you did not translate POST variables into QueryString and you say the
POST variables survive a 302 Redirection, then I'd highly suggest you look
at PHP's behavior because that'd be "automagic" on the part of PHP and would
be the first place I'd look for a bug.
If you are translating POST variables into QueryString, then I'd suggest you
look at your code.
I have a comparable scenario with ASP and it all worked fine for me... so
I'm not convinced it's the web server. I would look at PHP's behavior.
The best way to conclusively diagnose this is to use a Network Monitor to
observe the exact request/responses being generated for access to the PHP
page. It would immediately show whether it is PHP, IIS, the client, or your
code that is the problem.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Martin Harrison" <anonymous.DeleteThis@discussions.microsoft.com> wrote in message
news:0dee01c3a3a0$1f279b10$a301280a@phx.gbl...
Im using Win2kSP4 and IIS5
The script generates a page with form on it
this calls the script again but with with POST (form data)
and url+query string (Action and display options)
The script then processes the form (updates a database)
then calls its self again (via php header command)but with
just URL+query string (and does the impossible of
retaining teh post data)
I have used the same build of on php on apache and all is
ok
I have also used IE5 & 6 and get the same results, so im
convinced its something to do with the server rather than
browser, and find it hard to see how php would call its
self seeing im using the http header and it should be
being called from the browser/web server.
One other point - at teh begging of my script I convert
the post & url data that im expecting into varibles, but I
would expect them to all be cleared when the script exits -
indeed I tried unsetting them and it made no difference.
Martin
>-----Original Message-----
>So basically, the page first POSTs to itself, then
Redirects to itself with
>a URL+QueryString?
>
>Anyway, POST variables cannot be sent on the Redirect
because 302 Redirects
>do not include entity body, which is where the POST
variables are stored.
>
>What IIS version are you referring to.
>
>I tried on IIS5 (W2KSP4) to create a ASP page which POSTs
to itself, and on
>the POST, send a Redirect to itself with
URL+QueryString. I verified that
>it did receive the QueryString of the redirect, and not
the POST.
>
>So, this does not seem to be an IIS issue but rather
something specific to
>PHP or Browser.
>
>--
>//David
>IIS
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>//
>"Martin Harrison" <anonymous.DeleteThis@discussions.microsoft.com>
wrote in message
>news:0b3d01c3a2d6$c4ffb7e0$a501280a@phx.gbl...
>Hi,
>
>I am having a problem using php on IIS.
>A user fills in a form and submits to my script.
>After processing the script then calls itself again using
>a rediret header and passes on different variables via the
>URL. No POST variables are sent.
>
>When the script runs for the second time it appears to
>have been passed the previous POST variables.
>
>Using the same version of PHP and script on an apache
>server does not have the problem. Also I am NOT using
>sessions and have already tried disabling that setting in
>IIS.
>
>I have also noted that on apache the redirected url
>appears on the address bar while on IIS I only get the url
>from when the script was first called.
>
>Is this expected behaviour of IIS, and if so is their a
>way round it so that it only passes the variables I want
>into a script.
>
>Martin
>
>
>.
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
External

Since: Nov 04, 2003 Posts: 6
|
(Msg. 5) Posted: Wed Nov 05, 2003 6:07 pm
Post subject: Re: How to stop POST variables passing between pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
David,
Thanks for you help but im still stuck!
I have written a short and simple script which I have
tested and found to give exactly the same results. I have
included it below.
Also when you say network monitor I presume you mean one
like that in the adminitration tools menu. But I guess I
couldn't fathom out how to set the filters right as it
didn't capture anything usefull!. Ill try again when im
not accessing the server remotely but some pointers might
be helpful.
Anyway heres the script...
#!/php/php
<?
$scriptname = getenv ("SCRIPT_NAME");
$MyText = $HTTP_POST_VARS['mytext'];
$Action = $HTTP_GET_VARS['Action'];
switch($Action)
{
case 0: print 'Initial page - click form to send some
data to '.$scriptname.'?Action=1 which will then forward
to '.$scriptname.'?Action=2<BR>';
print '<FORM method="POST"
action="'.$scriptname.'?Action=1">Enter some text
here<INPUT name="mytext" value="some text"><INPUT
TYPE=SUBMIT></FORM>';
break;
case 1: header("Location: ".$scriptname."?Action=2");
break;
case 2: print 'The third page - this is a result of a
redirection. The variables are:<BR>
Action = '.$Action.' <BR>
mytext = '.$MyText;
print '<BR><BR>You should not be able to see a
value for mytext<BR>Also note that the address bar may be
indicating action 1 rather than 2.';
break;
}
?>
Martin
>-----Original Message-----
>>>Anyway, POST variables cannot be sent
>>>on the Redirect because 302 Redirects
>>>do not include entity body, which is
>>>where the POST variables are stored.
>
>>The script then processes the form (updates a database)
>>then calls its self again (via php header command)but
with
>>just URL+query string (and does the impossible of
>>retaining teh post data)
>
>If you did not translate POST variables into QueryString
and you say the
>POST variables survive a 302 Redirection, then I'd highly
suggest you look
>at PHP's behavior because that'd be "automagic" on the
part of PHP and would
>be the first place I'd look for a bug.
>
>If you are translating POST variables into QueryString,
then I'd suggest you
>look at your code.
>
>I have a comparable scenario with ASP and it all worked
fine for me... so
>I'm not convinced it's the web server. I would look at
PHP's behavior.
>
>The best way to conclusively diagnose this is to use a
Network Monitor to
>observe the exact request/responses being generated for
access to the PHP
>page. It would immediately show whether it is PHP, IIS,
the client, or your
>code that is the problem.
>
>--
>//David
>IIS
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>//
>"Martin Harrison" <anonymous.TakeThisOut@discussions.microsoft.com>
wrote in message
>news:0dee01c3a3a0$1f279b10$a301280a@phx.gbl...
>Im using Win2kSP4 and IIS5
>
>The script generates a page with form on it
>this calls the script again but with with POST (form data)
>and url+query string (Action and display options)
>The script then processes the form (updates a database)
>then calls its self again (via php header command)but with
>just URL+query string (and does the impossible of
>retaining teh post data)
>
>I have used the same build of on php on apache and all is
>ok
>I have also used IE5 & 6 and get the same results, so im
>convinced its something to do with the server rather than
>browser, and find it hard to see how php would call its
>self seeing im using the http header and it should be
>being called from the browser/web server.
>
>One other point - at teh begging of my script I convert
>the post & url data that im expecting into varibles, but I
>would expect them to all be cleared when the script
exits -
> indeed I tried unsetting them and it made no difference.
>
>Martin
>
>>-----Original Message-----
>>So basically, the page first POSTs to itself, then
>Redirects to itself with
>>a URL+QueryString?
>>
>>Anyway, POST variables cannot be sent on the Redirect
>because 302 Redirects
>>do not include entity body, which is where the POST
>variables are stored.
>>
>>What IIS version are you referring to.
>>
>>I tried on IIS5 (W2KSP4) to create a ASP page which POSTs
>to itself, and on
>>the POST, send a Redirect to itself with
>URL+QueryString. I verified that
>>it did receive the QueryString of the redirect, and not
>the POST.
>>
>>So, this does not seem to be an IIS issue but rather
>something specific to
>>PHP or Browser.
>>
>>--
>>//David
>>IIS
>>This posting is provided "AS IS" with no warranties, and
>confers no rights.
>>//
>>"Martin Harrison" <anonymous.TakeThisOut@discussions.microsoft.com>
>wrote in message
>>news:0b3d01c3a2d6$c4ffb7e0$a501280a@phx.gbl...
>>Hi,
>>
>>I am having a problem using php on IIS.
>>A user fills in a form and submits to my script.
>>After processing the script then calls itself again using
>>a rediret header and passes on different variables via
the
>>URL. No POST variables are sent.
>>
>>When the script runs for the second time it appears to
>>have been passed the previous POST variables.
>>
>>Using the same version of PHP and script on an apache
>>server does not have the problem. Also I am NOT using
>>sessions and have already tried disabling that setting in
>>IIS.
>>
>>I have also noted that on apache the redirected url
>>appears on the address bar while on IIS I only get the
url
>>from when the script was first called.
>>
>>Is this expected behaviour of IIS, and if so is their a
>>way round it so that it only passes the variables I want
>>into a script.
>>
>>Martin
>>
>>
>>.
>>
>
>
>
>.
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
External

Since: Aug 25, 2003 Posts: 2419
|
(Msg. 6) Posted: Thu Nov 06, 2003 12:12 am
Post subject: Re: How to stop POST variables passing between pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
I think the problem is in your script, as I had to make one fix on it to
have it work. I tried this fixed script out on PHP 4.3.1 , ISAPI version,
and I see what is expected:
The third page - this is a result of a redirection. The variables are:
Action = 2
mytext =
You should not be able to see a value for mytext
Also note that the address bar may be indicating action 1 rather than 2.
PHP did indicate a problem with this initial line:
#!/php/php
As it was causing PHP to send content prior to header modification, thus
invalidating the Location: header.
I noticed that the CGI version of PHP was hiding the shbang from output, but
this is not done by the ISAPI version. You are probably running the CGI
version, so this silence could be problematic for you.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Martin Harrison" <anonymous RemoveThis @discussions.microsoft.com> wrote in message
news:038101c3a3f1$961796c0$a601280a@phx.gbl...
David,
Thanks for you help but im still stuck!
I have written a short and simple script which I have
tested and found to give exactly the same results. I have
included it below.
Also when you say network monitor I presume you mean one
like that in the adminitration tools menu. But I guess I
couldn't fathom out how to set the filters right as it
didn't capture anything usefull!. Ill try again when im
not accessing the server remotely but some pointers might
be helpful.
Anyway heres the script...
#!/php/php
<?
$scriptname = getenv ("SCRIPT_NAME");
$MyText = $HTTP_POST_VARS['mytext'];
$Action = $HTTP_GET_VARS['Action'];
switch($Action)
{
case 0: print 'Initial page - click form to send some
data to '.$scriptname.'?Action=1 which will then forward
to '.$scriptname.'?Action=2<BR>';
print '<FORM method="POST"
action="'.$scriptname.'?Action=1">Enter some text
here<INPUT name="mytext" value="some text"><INPUT
TYPE=SUBMIT></FORM>';
break;
case 1: header("Location: ".$scriptname."?Action=2");
break;
case 2: print 'The third page - this is a result of a
redirection. The variables are:<BR>
Action = '.$Action.' <BR>
mytext = '.$MyText;
print '<BR><BR>You should not be able to see a
value for mytext<BR>Also note that the address bar may be
indicating action 1 rather than 2.';
break;
}
?>
Martin
>-----Original Message-----
>>>Anyway, POST variables cannot be sent
>>>on the Redirect because 302 Redirects
>>>do not include entity body, which is
>>>where the POST variables are stored.
>
>>The script then processes the form (updates a database)
>>then calls its self again (via php header command)but
with
>>just URL+query string (and does the impossible of
>>retaining teh post data)
>
>If you did not translate POST variables into QueryString
and you say the
>POST variables survive a 302 Redirection, then I'd highly
suggest you look
>at PHP's behavior because that'd be "automagic" on the
part of PHP and would
>be the first place I'd look for a bug.
>
>If you are translating POST variables into QueryString,
then I'd suggest you
>look at your code.
>
>I have a comparable scenario with ASP and it all worked
fine for me... so
>I'm not convinced it's the web server. I would look at
PHP's behavior.
>
>The best way to conclusively diagnose this is to use a
Network Monitor to
>observe the exact request/responses being generated for
access to the PHP
>page. It would immediately show whether it is PHP, IIS,
the client, or your
>code that is the problem.
>
>--
>//David
>IIS
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>//
>"Martin Harrison" <anonymous RemoveThis @discussions.microsoft.com>
wrote in message
>news:0dee01c3a3a0$1f279b10$a301280a@phx.gbl...
>Im using Win2kSP4 and IIS5
>
>The script generates a page with form on it
>this calls the script again but with with POST (form data)
>and url+query string (Action and display options)
>The script then processes the form (updates a database)
>then calls its self again (via php header command)but with
>just URL+query string (and does the impossible of
>retaining teh post data)
>
>I have used the same build of on php on apache and all is
>ok
>I have also used IE5 & 6 and get the same results, so im
>convinced its something to do with the server rather than
>browser, and find it hard to see how php would call its
>self seeing im using the http header and it should be
>being called from the browser/web server.
>
>One other point - at teh begging of my script I convert
>the post & url data that im expecting into varibles, but I
>would expect them to all be cleared when the script
exits -
> indeed I tried unsetting them and it made no difference.
>
>Martin
>
>>-----Original Message-----
>>So basically, the page first POSTs to itself, then
>Redirects to itself with
>>a URL+QueryString?
>>
>>Anyway, POST variables cannot be sent on the Redirect
>because 302 Redirects
>>do not include entity body, which is where the POST
>variables are stored.
>>
>>What IIS version are you referring to.
>>
>>I tried on IIS5 (W2KSP4) to create a ASP page which POSTs
>to itself, and on
>>the POST, send a Redirect to itself with
>URL+QueryString. I verified that
>>it did receive the QueryString of the redirect, and not
>the POST.
>>
>>So, this does not seem to be an IIS issue but rather
>something specific to
>>PHP or Browser.
>>
>>--
>>//David
>>IIS
>>This posting is provided "AS IS" with no warranties, and
>confers no rights.
>>//
>>"Martin Harrison" <anonymous RemoveThis @discussions.microsoft.com>
>wrote in message
>>news:0b3d01c3a2d6$c4ffb7e0$a501280a@phx.gbl...
>>Hi,
>>
>>I am having a problem using php on IIS.
>>A user fills in a form and submits to my script.
>>After processing the script then calls itself again using
>>a rediret header and passes on different variables via
the
>>URL. No POST variables are sent.
>>
>>When the script runs for the second time it appears to
>>have been passed the previous POST variables.
>>
>>Using the same version of PHP and script on an apache
>>server does not have the problem. Also I am NOT using
>>sessions and have already tried disabling that setting in
>>IIS.
>>
>>I have also noted that on apache the redirected url
>>appears on the address bar while on IIS I only get the
url
>>from when the script was first called.
>>
>>Is this expected behaviour of IIS, and if so is their a
>>way round it so that it only passes the variables I want
>>into a script.
>>
>>Martin
>>
>>
>>.
>>
>
>
>
>.
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
External

Since: Aug 25, 2003 Posts: 2419
|
(Msg. 7) Posted: Thu Nov 06, 2003 12:12 am
Post subject: Re: How to stop POST variables passing between pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
I think the problem is in your script, as I had to make one fix on it to
have it work. I tried this fixed script out on PHP 4.3.1 , ISAPI version,
and I see what is expected:
The third page - this is a result of a redirection. The variables are:
Action = 2
mytext =
You should not be able to see a value for mytext
Also note that the address bar may be indicating action 1 rather than 2.
PHP did indicate a problem with this initial line:
#!/php/php
As it was causing PHP to send content prior to header modification, thus
invalidating the Location: header.
I noticed that the CGI version of PHP was hiding the shbang from output, but
this is not done by the ISAPI version. You are probably running the CGI
version, so this silence could be problematic for you.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Martin Harrison" <anonymous.RemoveThis@discussions.microsoft.com> wrote in message
news:038101c3a3f1$961796c0$a601280a@phx.gbl...
David,
Thanks for you help but im still stuck!
I have written a short and simple script which I have
tested and found to give exactly the same results. I have
included it below.
Also when you say network monitor I presume you mean one
like that in the adminitration tools menu. But I guess I
couldn't fathom out how to set the filters right as it
didn't capture anything usefull!. Ill try again when im
not accessing the server remotely but some pointers might
be helpful.
Anyway heres the script...
#!/php/php
<?
$scriptname = getenv ("SCRIPT_NAME");
$MyText = $HTTP_POST_VARS['mytext'];
$Action = $HTTP_GET_VARS['Action'];
switch($Action)
{
case 0: print 'Initial page - click form to send some
data to '.$scriptname.'?Action=1 which will then forward
to '.$scriptname.'?Action=2<BR>';
print '<FORM method="POST"
action="'.$scriptname.'?Action=1">Enter some text
here<INPUT name="mytext" value="some text"><INPUT
TYPE=SUBMIT></FORM>';
break;
case 1: header("Location: ".$scriptname."?Action=2");
break;
case 2: print 'The third page - this is a result of a
redirection. The variables are:<BR>
Action = '.$Action.' <BR>
mytext = '.$MyText;
print '<BR><BR>You should not be able to see a
value for mytext<BR>Also note that the address bar may be
indicating action 1 rather than 2.';
break;
}
?>
Martin
>-----Original Message-----
>>>Anyway, POST variables cannot be sent
>>>on the Redirect because 302 Redirects
>>>do not include entity body, which is
>>>where the POST variables are stored.
>
>>The script then processes the form (updates a database)
>>then calls its self again (via php header command)but
with
>>just URL+query string (and does the impossible of
>>retaining teh post data)
>
>If you did not translate POST variables into QueryString
and you say the
>POST variables survive a 302 Redirection, then I'd highly
suggest you look
>at PHP's behavior because that'd be "automagic" on the
part of PHP and would
>be the first place I'd look for a bug.
>
>If you are translating POST variables into QueryString,
then I'd suggest you
>look at your code.
>
>I have a comparable scenario with ASP and it all worked
fine for me... so
>I'm not convinced it's the web server. I would look at
PHP's behavior.
>
>The best way to conclusively diagnose this is to use a
Network Monitor to
>observe the exact request/responses being generated for
access to the PHP
>page. It would immediately show whether it is PHP, IIS,
the client, or your
>code that is the problem.
>
>--
>//David
>IIS
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>//
>"Martin Harrison" <anonymous.RemoveThis@discussions.microsoft.com>
wrote in message
>news:0dee01c3a3a0$1f279b10$a301280a@phx.gbl...
>Im using Win2kSP4 and IIS5
>
>The script generates a page with form on it
>this calls the script again but with with POST (form data)
>and url+query string (Action and display options)
>The script then processes the form (updates a database)
>then calls its self again (via php header command)but with
>just URL+query string (and does the impossible of
>retaining teh post data)
>
>I have used the same build of on php on apache and all is
>ok
>I have also used IE5 & 6 and get the same results, so im
>convinced its something to do with the server rather than
>browser, and find it hard to see how php would call its
>self seeing im using the http header and it should be
>being called from the browser/web server.
>
>One other point - at teh begging of my script I convert
>the post & url data that im expecting into varibles, but I
>would expect them to all be cleared when the script
exits -
> indeed I tried unsetting them and it made no difference.
>
>Martin
>
>>-----Original Message-----
>>So basically, the page first POSTs to itself, then
>Redirects to itself with
>>a URL+QueryString?
>>
>>Anyway, POST variables cannot be sent on the Redirect
>because 302 Redirects
>>do not include entity body, which is where the POST
>variables are stored.
>>
>>What IIS version are you referring to.
>>
>>I tried on IIS5 (W2KSP4) to create a ASP page which POSTs
>to itself, and on
>>the POST, send a Redirect to itself with
>URL+QueryString. I verified that
>>it did receive the QueryString of the redirect, and not
>the POST.
>>
>>So, this does not seem to be an IIS issue but rather
>something specific to
>>PHP or Browser.
>>
>>--
>>//David
>>IIS
>>This posting is provided "AS IS" with no warranties, and
>confers no rights.
>>//
>>"Martin Harrison" <anonymous.RemoveThis@discussions.microsoft.com>
>wrote in message
>>news:0b3d01c3a2d6$c4ffb7e0$a501280a@phx.gbl...
>>Hi,
>>
>>I am having a problem using php on IIS.
>>A user fills in a form and submits to my script.
>>After processing the script then calls itself again using
>>a rediret header and passes on different variables via
the
>>URL. No POST variables are sent.
>>
>>When the script runs for the second time it appears to
>>have been passed the previous POST variables.
>>
>>Using the same version of PHP and script on an apache
>>server does not have the problem. Also I am NOT using
>>sessions and have already tried disabling that setting in
>>IIS.
>>
>>I have also noted that on apache the redirected url
>>appears on the address bar while on IIS I only get the
url
>>from when the script was first called.
>>
>>Is this expected behaviour of IIS, and if so is their a
>>way round it so that it only passes the variables I want
>>into a script.
>>
>>Martin
>>
>>
>>.
>>
>
>
>
>.
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
External

Since: Nov 04, 2003 Posts: 6
|
(Msg. 8) Posted: Sun Nov 09, 2003 2:13 pm
Post subject: Re: How to stop POST variables passing between pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
David,
I have now downloaded the latest version of PHP and tried
installing it in both ISAPI and CGI configurations.
I have found that in ISAPI mode it works correctly and in
CGI mode it does not (even with shbang removed).
I had not previously installed it as ISAPI as the PHP
install notes said that it wasnt production ready. But I
guess im going to have to take the risk in order to make
it work.
Thanks for your help.
Martin
>-----Original Message-----
>I think the problem is in your script, as I had to make
one fix on it to
>have it work. I tried this fixed script out on PHP
4.3.1 , ISAPI version,
>and I see what is expected:
>
>The third page - this is a result of a redirection. The
variables are:
>Action = 2
>mytext =
>
>You should not be able to see a value for mytext
>Also note that the address bar may be indicating action
1 rather than 2.
>
>
>PHP did indicate a problem with this initial line:
>#!/php/php
>
>As it was causing PHP to send content prior to header
modification, thus
>invalidating the Location: header.
>
>I noticed that the CGI version of PHP was hiding the
shbang from output, but
>this is not done by the ISAPI version. You are probably
running the CGI
>version, so this silence could be problematic for you.
>
>
>--
>//David
>IIS
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>//
>"Martin Harrison" <anonymous.RemoveThis@discussions.microsoft.com>
wrote in message
>news:038101c3a3f1$961796c0$a601280a@phx.gbl...
>David,
>
>Thanks for you help but im still stuck!
>I have written a short and simple script which I have
>tested and found to give exactly the same results. I have
>included it below.
>
>Also when you say network monitor I presume you mean one
>like that in the adminitration tools menu. But I guess I
>couldn't fathom out how to set the filters right as it
>didn't capture anything usefull!. Ill try again when im
>not accessing the server remotely but some pointers might
>be helpful.
>
>Anyway heres the script...
>
>#!/php/php
><?
>
>$scriptname = getenv ("SCRIPT_NAME");
>$MyText = $HTTP_POST_VARS['mytext'];
>$Action = $HTTP_GET_VARS['Action'];
>
>switch($Action)
> {
> case 0: print 'Initial page - click form to send some
>data to '.$scriptname.'?Action=1 which will then forward
>to '.$scriptname.'?Action=2<BR>';
> print '<FORM method="POST"
>action="'.$scriptname.'?Action=1">Enter some text
>here<INPUT name="mytext" value="some text"><INPUT
>TYPE=SUBMIT></FORM>';
> break;
>
> case 1: header("Location: ".$scriptname."?Action=2");
> break;
>
> case 2: print 'The third page - this is a result of a
>redirection. The variables are:<BR>
> Action = '.$Action.' <BR>
> mytext = '.$MyText;
> print '<BR><BR>You should not be able to see
a
>value for mytext<BR>Also note that the address bar may be
>indicating action 1 rather than 2.';
> break;
> }
>
>?>
>
>Martin
>
>>-----Original Message-----
>>>>Anyway, POST variables cannot be sent
>>>>on the Redirect because 302 Redirects
>>>>do not include entity body, which is
>>>>where the POST variables are stored.
>>
>>>The script then processes the form (updates a database)
>>>then calls its self again (via php header command)but
>with
>>>just URL+query string (and does the impossible of
>>>retaining teh post data)
>>
>>If you did not translate POST variables into QueryString
>and you say the
>>POST variables survive a 302 Redirection, then I'd
highly
>suggest you look
>>at PHP's behavior because that'd be "automagic" on the
>part of PHP and would
>>be the first place I'd look for a bug.
>>
>>If you are translating POST variables into QueryString,
>then I'd suggest you
>>look at your code.
>>
>>I have a comparable scenario with ASP and it all worked
>fine for me... so
>>I'm not convinced it's the web server. I would look at
>PHP's behavior.
>>
>>The best way to conclusively diagnose this is to use a
>Network Monitor to
>>observe the exact request/responses being generated for
>access to the PHP
>>page. It would immediately show whether it is PHP, IIS,
>the client, or your
>>code that is the problem.
>>
>>--
>>//David
>>IIS
>>This posting is provided "AS IS" with no warranties, and
>confers no rights.
>>//
>>"Martin Harrison" <anonymous.RemoveThis@discussions.microsoft.com>
>wrote in message
>>news:0dee01c3a3a0$1f279b10$a301280a@phx.gbl...
>>Im using Win2kSP4 and IIS5
>>
>>The script generates a page with form on it
>>this calls the script again but with with POST (form
data)
>>and url+query string (Action and display options)
>>The script then processes the form (updates a database)
>>then calls its self again (via php header command)but
with
>>just URL+query string (and does the impossible of
>>retaining teh post data)
>>
>>I have used the same build of on php on apache and all
is
>>ok
>>I have also used IE5 & 6 and get the same results, so im
>>convinced its something to do with the server rather
than
>>browser, and find it hard to see how php would call its
>>self seeing im using the http header and it should be
>>being called from the browser/web server.
>>
>>One other point - at teh begging of my script I convert
>>the post & url data that im expecting into varibles,
but I
>>would expect them to all be cleared when the script
>exits -
>> indeed I tried unsetting them and it made no
difference.
>>
>>Martin
>>
>>>-----Original Message-----
>>>So basically, the page first POSTs to itself, then
>>Redirects to itself with
>>>a URL+QueryString?
>>>
>>>Anyway, POST variables cannot be sent on the Redirect
>>because 302 Redirects
>>>do not include entity body, which is where the POST
>>variables are stored.
>>>
>>>What IIS version are you referring to.
>>>
>>>I tried on IIS5 (W2KSP4) to create a ASP page which
POSTs
>>to itself, and on
>>>the POST, send a Redirect to itself with
>>URL+QueryString. I verified that
>>>it did receive the QueryString of the redirect, and not
>>the POST.
>>>
>>>So, this does not seem to be an IIS issue but rather
>>something specific to
>>>PHP or Browser.
>>>
>>>--
>>>//David
>>>IIS
>>>This posting is provided "AS IS" with no warranties,
and
>>confers no rights.
>>>//
>>>"Martin Harrison" <anonymous.RemoveThis@discussions.microsoft.com>
>>wrote in message
>>>news:0b3d01c3a2d6$c4ffb7e0$a501280a@phx.gbl...
>>>Hi,
>>>
>>>I am having a problem using php on IIS.
>>>A user fills in a form and submits to my script.
>>>After processing the script then calls itself again
using
>>>a rediret header and passes on different variables via
>the
>>>URL. No POST variables are sent.
>>>
>>>When the script runs for the second time it appears to
>>>have been passed the previous POST variables.
>>>
>>>Using the same version of PHP and script on an apache
>>>server does not have the problem. Also I am NOT using
>>>sessions and have already tried disabling that setting
in
>>>IIS.
>>>
>>>I have also noted that on apache the redirected url
>>>appears on the address bar while on IIS I only get the
>url
>>>from when the script was first called.
>>>
>>>Is this expected behaviour of IIS, and if so is their a
>>>way round it so that it only passes the variables I
want
>>>into a script.
>>>
>>>Martin
>>>
>>>
>>>.
>>>
>>
>>
>>
>>.
>>
>
>
>.
><!-- ~MESSAGE_AFTER~ --> >> Stay informed about: How to stop POST variables passing between pages |
|
| Back to top |
|
 |  |
| Related Topics: | ASP Pages Occasionally Stop Working With II6 - Hi, We are running a Windows 2003 server with IIS 6.0. On occasion, our ASP pages will stop working and we will have to reset the server to make them run again. Regular html pages are fine. The server may be up for a month or so actively using AS...
Form Variables Not Posting - I have a few users that are unable to post form variables to some of my cgi scripts. It appears that their browsers will not send the information from the current page. Now, this doesn't happen on every machine that goes to this page. I am okay when..
IIS Service Won't Stop - I am having problems getting my IIS service to stop. It tries for a long time and even goes through the process of trying to stop the WWW service and other dependencies. When it gives up it just gives a generic message that it was unable to stop th...
IIS site stop? - Does anyone know the KB article # for the patch that solves the problem where all IIS websites stop? I think it was a common hack about a year ago. Thanks!
How to stop IIS from binding to all IP addresses??? - Hi all, my problem is the following. I want to run Apache and IIS on the same machine. Whereas Apache strictly binds to only those IPs I assign to it, IIS always binds to the address I assign to it, plus it returns the following nice message on all.. |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|