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

  • SEARCH
  • Home
  • 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 8043553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:56:19+00:00 2026-06-05T04:56:19+00:00

I want to disable HTTP GET method for some of my php pages in

  • 0

I want to disable HTTP GET method for some of my php pages in my website. Can I do it in php code?

Lets suppose I have two pages a.html and action.php. Now a.html is normal page can be accessed with any method and it submits the information to action.php. But I want that information submitted to action.php can only be submitted through post method.

  • 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-06-05T04:56:21+00:00Added an answer on June 5, 2026 at 4:56 am

    Send a Method Not Allowed header along with some explanatory text (preferably something friendlier and more useful then my example below).

    Exit afterwards so you don’t continue processing with the regular page.

    if ($_SERVER['REQUEST_METHOD'] === 'GET') {
      header('Method Not Allowed', true, 405);
      echo "GET method requests are not accepted for this resource";
      exit;
    }
    

    You might want to consider white listing (and testing for the absence of methods you do accept) instead of black listing GET. (Since you might not want PUT, DELETE, etc either).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to disable the left bar button when my webview is loading can
I want to disable or also I have does not give permission entering the
I want to read a sequence of bytes from my accelerometer. I can't get
I have this situation where I have some pictures: http://www.example.com/test1.jpg http://www.example.com/test2.jpg http://www.example.com/test3.jpg .... some
I want to disable a website programatically for licensing reasons, and I want to
I have a Rails controller with a create method, and I want to POST
How do I get Firebug to do this: (from the Firebug website http://getfirebug.com/using.html )
Fiddle: http://jsfiddle.net/ugzux/ As you can see, I have a form with a disabled (via
i have a litte question.. i want to disable the direct access to my
I use some code from the PHP manual to make an exception test, but

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.