![]() |
get or post?
Is there a way to know if the current page is a result of a get or
post? |
Re: get or post?
Larry wrote:
> Is there a way to know if the current page is a result of a get or > post? Yes. PointedEars -- Use any version of Microsoft Frontpage to create your site. (This won't prevent people from viewing your source, but no one will want to steal it.) -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.) |
Re: get or post?
Thomas 'PointedEars' Lahn wrote:
> Larry wrote: > >> Is there a way to know if the current page is a result of a get or >> post? > > Yes. > and of course, no. Depending on where you are looking at the 'current page' :-) > > PointedEars |
Re: get or post?
On Jan 25, 6:13*am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote: >> Is there a way to know if the current page is a result of a get or >> post? > > Yes. No. At least, assuming you're discussing doing this from Javascript in a web browser. For any POST you perform, the server could send a redirect to a GET. If you have control on the server-side, you could echo the request type into a JS variable; in PHP it might be var httpMethod = "<?php echo $_SERVER['REQUEST_METHOD']; ?>" Good luck, -- Scott |
Re: get or post?
Scott Sauyet wrote:
> Thomas 'PointedEars' Lahn wrote: >>> Is there a way to know if the current page is a result of a get or >>> post? >> Yes. ^^^^ > No. > > At least, assuming you're discussing doing this from Javascript in a > web browser. For any POST you perform, the server could send a > redirect to a GET. > > If you have control on the server-side, you could echo the request > type into a JS variable; in PHP it might be > > var httpMethod = "<?php echo $_SERVER['REQUEST_METHOD']; ?>" See, there is a way :) PointedEars -- Use any version of Microsoft Frontpage to create your site. (This won't prevent people from viewing your source, but no one will want to steal it.) -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.) |
Re: get or post?
Thomas 'PointedEars' Lahn wrote:
> Scott Sauyet wrote: > >> Thomas 'PointedEars' Lahn wrote: >>>> Is there a way to know if the current page is a result of a get or >>>> post? >>> Yes. > ^^^^ >> No. >> >> At least, assuming you're discussing doing this from Javascript in a >> web browser. For any POST you perform, the server could send a >> redirect to a GET. >> >> If you have control on the server-side, you could echo the request >> type into a JS variable; in PHP it might be >> >> var httpMethod = "<?php echo $_SERVER['REQUEST_METHOD']; ?>" > > See, there is a way :) > > Right little humourist, is our resident elf...;-) > PointedEars |
Re: get or post?
Thomas 'PointedEars' Lahn wrote on 25 jan 2010 in comp.lang.javascript:
> Scott Sauyet wrote: > >> Thomas 'PointedEars' Lahn wrote: >>>> Is there a way to know if the current page is a result of a get or >>>> post? >>> Yes. > ^^^^ >> No. >> >> At least, assuming you're discussing doing this from Javascript in a >> web browser. For any POST you perform, the server could send a >> redirect to a GET. >> >> If you have control on the server-side, you could echo the request >> type into a JS variable; in PHP it might be >> >> var httpMethod = "<?php echo $_SERVER['REQUEST_METHOD']; ?>" > > See, there is a way :) No there is not. The new page can never know if the page request is 1 a result of a bona fide form-get or 2 just from a link contaning an URL with querystring. You can never know if the page request is from a form-post just if it tests positive a querystring as this could be contained in the form post action='...?a=b'. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |
Re: get or post?
On Jan 25, 4:00*pm, "Evertjan." <exjxw.hannivo...@interxnl.net> wrote:
> The new page can never know if the page request is > 1 a result of a bona fide form-get > or > 2 just from a link contaning an URL with querystring. I'm not sure that is a meaningful distinction. At the HTTP level, both are GET requests, so even the server doesn't distinguish this. -- Scott |
Re: get or post?
Scott Sauyet wrote on 25 jan 2010 in comp.lang.javascript:
> On Jan 25, 4:00’pm, "Evertjan." <exjxw.hannivo...@interxnl.net> wrote: >> The new page can never know if the page request is >> 1 a result of a bona fide form-get >> or >> 2 just from a link contaning an URL with querystring. > > I'm not sure that is a meaningful distinction. At the HTTP level, > both are GET requests, so even the server doesn't distinguish this. No, they could also be POST requests at ther same time. If you define a GET request als if without a querystring, the whole OQ is meaningless. The only interesting Q is if there is POST content and if there is querytring content. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |
Re: get or post?
"Evertjan." <exjxw.hannivoort@interxnl.net> writes:
> Thomas 'PointedEars' Lahn wrote on 25 jan 2010 in comp.lang.javascript: >> Scott Sauyet wrote: >>> [OP, ed.] >>>>> Is there a way to know if the current page is a result of a get or >>>>> post? >>> var httpMethod = "<?php echo $_SERVER['REQUEST_METHOD']; ?>" >> >> See, there is a way :) > > No there is not. I read that as wanting to know the request method, and I would think that a HTTP server cannot resolve a resource and send response headers without knowing that. I wonder what you read. |
| All times are GMT. The time now is 11:00 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.