on-internet
← Community

PHP Warning: Undefined array key when processing form array inputs

Stack Overflow ·

I am practicing with PHP arrays and forms. When running my code, I get the following warning: Warning: Undefined array key 3 in php Even though the output still prints, I would like to understand why this warning occurs. Here is the HTML form (Q4.php): <!DOCTYPE html> <html> <head><title>Number of Students</title></head> <body> <form action="Q4.php"> <table> <tr> <td>Number of Students:</td> <td><input type="text" name="num" size="5"></td> <td><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html> Here is the second PHP form (Q4index.php): <!DOCTYPE html> <html> <head

Comments

Sign in or sign up to comment and upvote.

No comments yet.