/ Published in: PHP
URL: http://reusablecode.blogspot.com/2008/12/ispostback.html
Expand |
Embed | Plain Text
<?php /* Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved. This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. */ // Determine whether the page was requested via GET or POST. function isPostBack() { return ($_SERVER['REQUEST_METHOD'] == 'POST'); } ?>
Comments
Subscribe to comments
You need to login to post a comment.

Sometimes I wonder if people are really serious about the submitting people like this one...
I mean: What the hell? This ain't something about "for beginners", it is just crap.
if($_POST) and you're done...
You can use that shortcut if you want. Some consider checking the request method to be more proper.
If the quality of my submissions here is in question, I refer you to my other snippets.
I take note that you have never contributed any snippets, which brings into question the value of your comment.
The fact that you're a user of $SERVER['REQUESTMETHOD'] brings the value of any of your snippets into question.