Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:12:35+00:00 2026-05-23T12:12:35+00:00

After reading: When do you use POST and when do you use GET? Mixing

  • 0

After reading:

  • When do you use POST and when do you use GET?
  • Mixing GET with POST – is it a bad practice?

I understand, that GET is used to retrieve a page without changing the server and POST is used for things (insert, update, delete), that change the server.

Now I have written a page which is called with a GET request with parameter StationNr set. The user can fill a form and makes a POST request to the same page with parameter Filter set. But I don’t want to miss the parameter StationNr thus I thought I give it into a hidden input field. But then the parameter StationNr is either in the $_GET variable (first call) or in the $_POST variable (second call). I can do something like:

if (isset($_GET['StationNr']))
    $snr = $_GET['StationNr'];
else if (isset($_POST['StationNr']))
    $nr = $_POST['StationNr'];

But I don’t like this. Also I don’t want to use $_REQUEST['StationNr'] because of: When and why should $_REQUEST be used instead of $_GET / $_POST / $_COOKIE?

I think this is a common issue but I haven’t faced it yet because I’m a beginner in writing php pages. How did you solve this problem?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:12:35+00:00Added an answer on May 23, 2026 at 12:12 pm

    Although you can use ?foo=bar to push GET values in a POST request, I’d suggest checking the request method instead:

    if($_SERVER['REQUEST_METHOD'] == 'POST') { ... }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading this: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it I came to the conclusion that it is not valid
After reading this post, and the suggestion to use Team Edition for Database Professionals
After reading this post regarding the use ECC to implement the hashing using aa
After reading this article http://lukast.mediablog.sk/log/?p=155 I decided to use mingw on linux to compile
What is Lazy Loading? [Edit after reading a few answers] Why do people use
I've been struggling to get my mind around classes. Even after reading several websites
After reading Jeff's blog post on Protecting Your Cookies: HttpOnly . I'd like to
After reading E-myth Revisited, I realize that I can do a better job at
Recently, I've got a dangerous idea into my head after reading this blog post.
LINQ include missing. after reading this post: http://romiller.com/2010/07/14/ef-ctp4-tips-tricks-include-with-lambda/ i would like to use include.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.