forms - PHP mixing POST and GET Requests to one page -


after reading:

i understand, used retrieve page without changing server , post used things (insert, update, delete), change server.

now have written page called request parameter stationnr set. user can fill form , makes post request same page parameter filter set. don't want miss parameter stationnr thought give hidden input field. parameter stationnr either in $_get variable (first call) or in $_post variable (second call). can like:

if (isset($_get['stationnr']))     $snr = $_get['stationnr']; else if (isset($_post['stationnr']))     $nr = $_post['stationnr']; 

but don't this. don't want use $_request['stationnr'] because of: when , why should $_request used instead of $_get / $_post / $_cookie?

i think common issue haven't faced yet because i'm beginner in writing php pages. how did solve problem?

thanks!

although can use ?foo=bar push values in post request, i'd suggest checking request method instead:

if($_server['request_method'] == 'post') { ... } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -