<meta charset="utf8">
<p>Normal year and leap year calculator</p>
<form>
<input type="text" name= "num1">
<input type="submit" value="Judgment">
</form>
<?php
$num1=$_GET['num1'];
if(!is_numeric($num1))
{echo 'Please enter the year correctly';
exit;}
if($num1%4 ==0 and $num1 0!==0 or $num1@0==0)
{echo $num1.
$_GET['num1'] does not exist when you first enter. It will be an error to assign a non-existent value to a variable, so give $num1 an initial value, such as: $num1 = isset($_GET[' num1']) ? $_GET['num1'] : 2019;
If you don't want the sentence "2019 is a normal year" to appear as soon as you refresh, modify the program as follows:
<?php
if (!empty($_GET['num1'])){
$num1=$_GET['num1'];
if(!i
You can print out the value of $num1 when entering for the first time. I guess it is NULL. NULL cannot be used as an operation.