I am attempting to validate a credit card number input to be at least 16 numbers. My code doesn't seem to work. I don't feel too confident about my syntax. Any help?... thanks.
<form name="ccard" action="validate.php" method=post>
CC Type
<select name="cc_type">
<option value="mc">Master Card</option>
<option value="visa">Visa</option>
</select><br>
Creditcard number:
<input type=number name="ccard_num" value="num"><br>
Exp Year:
<input><br>
Exp Month:
<input>
</form>
php code
<?php
$cc_length = $_POST['ccard_num'];
if (strlen( $cc_length == 15) {
echo "Valid";
}
elseif (strlen($cc_length != 15) {
echo "Invalid entry";
}
?>