Awesome q2a theme

Where is the error in php code?

0 like 0 dislike
29 views
Help , vidaet error:
Notice: Undefined index: submit in ..\\Playground\\

PHP Notice: Undefined index: submit in ..\\Playground\\
-----------------------------------------------------
Code:

<?phpif($_POST["submit"]){$min = $_POST["min"];$max = $_POST["min"];$n = rand ($min , $max);echo $n;}?>

Did everything like in the video https://www.youtube.com/watch?v=FCHxBdE0Sqk&t=196s
by | 29 views

3 Answers

0 like 0 dislike
$min = $_POST["min"];
$max = $_POST["min"];
by
0 like 0 dislike
It should be so.
<?php\rif($_POST["submit"])\r{\r$min = $_POST["min"];\r$max = $_POST["max"];\r$n = rand ($min , $max);\recho $n;\r}\r?>
by
0 like 0 dislike
\r\r\r\r\r\r<?php\rif (isset($_POST['submit'])) {\r$min = intval($_POST['min']);\r$max = intval($_POST['max']);\r$n = rand($min , $max);\recho $n;\r}\r?>\r
by

Related questions

0 like 0 dislike
4 answers
asked Apr 22, 2019 by 0ldn0mad
0 like 0 dislike
1 answer
asked May 21, 2019 by andrei2018
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Apr 4, 2019 by redd_i
0 like 0 dislike
1 answer
asked Jun 8, 2019 by duha96
110,608 questions
257,187 answers
0 comments
40,796 users