Possible Duplicate:
PHP detecting request type (GET, POST, PUT or DELETE)
I want to display a warning when people submit a form more than one time, and when he use GET
to request a page the count
variable reset to 0;
I'm using this technique:
<input type="hidden" name="submissioncount" value="<?php echo $subCount; ?>" />
But it seems to me $_GET and $_POST alway exist:
<?php
if(isset($_GET)){
$warning = "GET exist";
}else{
$warning = 'GET not exist';
}
if(isset($_POST)){
$warning2 = "POST exsit";
}else{
$warning2 = 'POST not exist ';
}
?>
<!DOCTYPE html>
<html>
<head></head>
<body>
<?php
echo $warning;
echo $warning2;
?>
<form acion='<?php echo $_SERVER['PHP_SELF']?>' method='POST' >
<input type='submit' />
</form>
</body>
</html>
It turns out it aways return exist? Where I did wrong or any other work round for it?