-1
  if($_POST) {
  $type = $_POST['roll'];
  if $type == 1 {
    $number = rand(1,100)
    if $number <= 50 {
      echo "Winner!"
    }
    else {
      echo "Loser!"
    }
  }
};

Can't figure out what is wrong. I am kinda new to PHP also. Type (or roll) is always 1 (for now)

1 Answers1

0

I think you just need to put

if ($type == 1) {

instead of your actual statement, the condition of the if need that. And so you'll need it too on the second "if"

Watch what your error is showing, it's exactly what you need.