Your script does not work because a form variable is a string and therefore not an integer The below script will work properly
<?php
$i = $_REQUEST['number1'];//use $i =$_POST['number1'] instead
$j = $_REQUEST['number2'];//use $i =$_POST['number2'] instead
if (is_numeric($i) && is_numeric($j)){
if ($i>$j){
print ("$i is greater than $j");
}else if ($j>$i) {
print ("$j is greater than $i");
} else if ($i == $j) {
print "$j and $i are equal";
} else {
print "Congrats, you monkeyed up my script";
}
}else {
print "One or more values entered was not a number";
}
?>