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 8273163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:23:07+00:00 2026-06-08T07:23:07+00:00

In my MVC framework I sometimes redirect after form submission. Say you post a

  • 0

In my MVC framework I sometimes redirect after form submission. Say you post a form to /example/input.

I want to add the proper header code and explanatory text in PHP with e.g. header('HTTP/1.1 404 Not Found');

1) Your input contains errors. You stay on the /example/input page and get the form again, marked up with errors etc. Which HTTP 1.1. code and text would be the proper one to send with this the redirect instruction?

2) Your input is ok, the element is saved, and you are redirected via Header('Location: ...') to /example/success. Which HTTP 1.1. code and text would be the proper one here?

3) The PHP code throws an error due to misconfiguration, missing include file, corrupt database connection, or whatever else is going wrong sometimes. Which HTTP 1.1. code and text would be the proper one here?

I have looked at the codes here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Number 200 appears right for 1), while number 301/302 appear right for 2), and number 500 for 3). But in all three cases, I find that the title/explanation following the codes on the link above is not exactly fitting the scenario I’m describing above. Should I choose other codes/text?

  • 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-08T07:23:10+00:00Added an answer on June 8, 2026 at 7:23 am

    Cases one and two describe variants of the same situation: you submit a form by POST, the server handles it and redirects the client to either a success page or back to the form. For both cases, “303 See Other” is the correct response. This is the correct way to redirect the client to a resource using the GET method after the server has correctly handled a POST request. According to the specification:

    This method exists primarily to allow the output of a POST-activated
    script to redirect the user agent to a selected resource.

    For Case 3, the 500 code is usually suitable for most critical errors.

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

Sidebar

Related Questions

In an MVC framework, responsible for defining the header would be the controller or
I want my MVC application to be step into MVC framework contrib project also
I have a asp.net website, which use MVC 1.0 framework, but I found sometimes
I am using a MVC framework which is a bit like struts. So, say
I am learning the MVC framework after a background in traditional ASP.NET webforms. I
i use my own mvc framework. and post action is : function post($pid =
I want my asp.net mvc framework system to send an e-mail everytime a certain
i am using my own mvc framework and i want to filter and escape
I'm making an MVC-framework in PHP and am trying to recreate a beautiful feature
I know that an MVC framework allows you to separate business logic, data base

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.