<?php
if(isset($_POST["submit"])==true){
$n=TRUE;
if(strlen($_POST["num"])<>16){
echo"wrong number length";
$n=FALSE;
}
if((strpos($_POST["num"],"4")>0||strpos($_POST["num"],"4")==false)){
echo"wrong starting number";
$n=FALSE;
}
if($n==TRUE){
echo "good job";
}


}

else{
?>
<!DOCTYPE html>
<html>
<body>

<h2>credit card number</h2>

<form method="POST">
  <label for="num">credit card number:</label><br>
  <input type="number" id="num" name="num"><br>
  <input type="submit" name="submit">

  </form> 



</body>
</html>
<?php
}
?>
