Need Assistance?

support@tutorialshub.in

Forms, Superglobals & HTTP Handling

Redirects & Post-Redirect-Get (PRG) Pattern

ADVERTISEMENT
PHP Free Lesson
5 min read
ADVERTISEMENT

Have you ever refreshed a page after submitting a form and seen the browser warn "Confirm Form Resubmission"? To prevent duplicate orders or comments, always use the Post-Redirect-Get (PRG) pattern: process the POST, store a flash message in $_SESSION, send header("Location: ..."), and call exit; immediately.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you