Hi,
I was just wondering if php is able to do the 'page post back function' like asp.net ? If possible, can someone guide me along with it or any site recommendations for reading up will be greatly appreciated. Thank you. :)
Regards,
heels
As pointed out, using a self‑processing form is the straightforward way to accomplish the same end as an ASP.NET "postback." The big difference is that ASP.NET WebForms bundles a control lifecycle and ViewState for you; PHP is stateless, so you detect the incoming request and manage any state explicitly (sessions, hidden fields, or storage). For production sites that need the same UX, handle validation and state on the server side and use patterns that avoid duplicate submissions and security holes.
Practical checklist to apply immediately:
Further reading: PHP form handling in the manual (PHP Forms Tutorial), the PRG pattern (Post/Redirect/Get), and CSRF mitigation guidance (OWASP CSRF Prevention Cheat Sheet). This covers the practical differences and safe ways to implement page postback behavior in PHP for .
Jump to Post— ShawnCplus 456You set the form's action to
<?php echo $_SERVER['PHP_SELF'] ?>. The page will post back to itself.
You set the form's action to <?php echo $_SERVER['PHP_SELF'] ?> . The page will post back to itself.
You set the form's action to
<?php echo $_SERVER['PHP_SELF'] ?>. The page will post back to itself.
AH, thank you. :)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.