1.if(isset($_GET['submit'])) atau
2.if(isset($_POST['submit']))
3.if($_SERVER['REQUEST_METHOD'] == "POST")
4. atau menambahkan hidden filed
<input type='hidden' name='submit' /> , kemudaian dilakukan pengecekan seperti no.2
PHP, CodeIgniter, Python, Bootstrap, CSS, Jquery, HTML 5, Sublime text2, Regural Expresion, CMS Joomla, Opencart etc...
1.if(isset($_GET['submit'])) atau
2.if(isset($_POST['submit']))
3.if($_SERVER['REQUEST_METHOD'] == "POST")
4. atau menambahkan hidden filed
<input type='hidden' name='submit' /> , kemudaian dilakukan pengecekan seperti no.2
contoh form:
<form name="new user" method="post" action="step2_check.php">
<input type="text" name="mail"/> <br />
<input type="password" name="password"/><br />
<input type="submit" value="continue"/>
</form>
cara ceknya :
if (!empty($_POST["mail"])) {
echo "Yes, mail is set";
}else{
echo "N0, mail is not set";
}
cara cek salah :
if (isset($_POST["mail"])) {
echo "Yes, mail is set";
}else{
echo "N0, mail is not set";
}