When I say 'new', I mean that this is just about the first time I'm attempting php.
Anyway. I keep getting this error notice "Undefined index: type in c:\x\calculator.php on line 33", but it still echoes "You forgot to pick mathtype!" and the calculator works fine. This error notice occurs only when I don't select any radio box for math type (+-/*).
//Part of the form
<form action="calculator.php" method="post">
<input type="text" name="1stnumber">
<input type="text" name="2ndnumber">
<input type="radio" name="type" value="addition">
<input type="radio" name="type" value="subtraction">
<input type="submit" name="send">
<?php
//My variables
$number = $_POST['1stnumber']
$numbero = $_POST['2ndnumber']
$mathtype = $_POST['type'] /* **<-line 33** */
//The calculation part of the form here, which is working
//Tell the user if he didn't pick a math type (+-)
if(is_null($mathtype)){
echo "You forgot to pick mathtype!"
}
?>
Tried with elseif as well.. I don't see what's wrong between line 33 and the if(is_null()) line!
Sorry if it looks poor, messy, or if something doesn't make sense. Might be a few typos as well. Any help is appreciated.