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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:05:13+00:00 2026-05-25T19:05:13+00:00

Coming from a bit of a conventional (if rusty) programming background, I am busy

  • 0

Coming from a bit of a conventional (if rusty) programming background, I am busy getting to grips with the “stateless” nature of web sites. It is quite a mindset change!

I’ve created a small web site for the team in which I work to use internally to track some aspects of our daily grind. The site is functional, I’m pretty proud of what I managed to come up with, bla bla bla.

However I read something somewhere which suggests that I may have done it in a bad way. In particular, the central page of the team website does most of the work. It checks where you came from and then “switches” to perform some work (make some changes in the database) and then again it renders the page.

In many cases the page simply calls itself! What I do is I display a table. In the last column of each row is a set of html forms. Each form have a submit button, at least one hidden field. The “submit” buttons have names/values such as “Delete” “Modify” “Archive” etc.

If $_POST['submit'] == "delete" then I perform that function on a row identified by a hidden field. Vis a vis for “Archive”. For Modify I open a new page, display a form with default values, and when the user submits the form the main PHP page is once again called to do an SQL update before it displays the table.

So essentially a large (and growing) case construct near the start of the main page does most of the work, even including the login button!

It seems quite neat and organized this way, but I have two questions:

  1. Is there a way to eliminate the “Resend form data” prompt when a user press Back? The back button doesn’t make much sense on this website, most of the time, but we are dealing with humans here. I notice other people have posted similar questions about logout buttons and the like, but the answers I’ve found so far makes little or no sense to me.

  2. Is this bad programming practice, particularly the whole PHP-calls-itself-from-a-form-action concept …. ?

Thank you for the time!

  • 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-25T19:05:13+00:00Added an answer on May 25, 2026 at 7:05 pm

    To your questions:

    1. You are looking for something like Post-redirect-get, that means after submitting you ‘do the work’ with your data and redirect your user right after, so hitting the back button won’t re-submit!

    2. In general that’s how it works…in the beginning. After a while you should have a look at OOP (Object oriented programming) or for starters just seperate each action into functions, maybe those functions even into seperate files. Check the PHP Manual for functions or if you are really keen to learn more, OOP would be the holy grail, but that’s a ‘bit’ complex 😉

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

Sidebar

Related Questions

I'd like to play around a bit with pure web app programming. Coming from
Im a bit new to T-SQL, Coming from a MySQL background Im still adapting
I'm coming from a Rails background, and am having a bit of trouble making
I'm currently learning the C programming language (coming from Java) and I'm a bit
I have read a bit about casting in C++. Coming from a C background,
I'm currently teaching myself python (coming from no programming background, but a lot of
Since coming from a pure C# background I am having a little bit of
Coming from a Java/C# background, the MEL site came as a bit of a
Coming from a Classic ASP background, I'm used to multiple forms on a page,
Coming from a background, I'm familiar with GUI editors that do a poor job

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.