Search the Community
Showing results for tags 'lotto'.
-
Struggling with creating the following: a. The authorized user can select one or both of the two available lottery services (in form of checkboxes) provided by your website. Generate six sets of LOTTO 6/49 numbers (sorted in ascending order) when option one, labeled as “LOTTO 6/49”, is checked. One set of “LOTTO 6/49” numbers consists of 6 unique numbers between 1 and 49 inclusively. Generate six sets of LOTTO MAX numbers (sorted in ascending order) when option two, labeled as “LOTTO MAX”, is checked. One set of “LOTTO MAX” numbers consists of 7 unique numbers between 1 and 49 inclusively. b. When the authorized user submits the form with one or both of the two available services checked, your web server will generate six sets of lottery numbers for each type accordingly and display these numbers of each type of lotteries to the user. Code so far: <?php error_reporting(E_ALL | E_NOTICE); ini_set('display_errors','1'); if(!isset($_SESSION)){ session_start(); } ?> <html> <head> <title> Choose Tickets</title> </head> <body> <h2> Choose your tickets</h2> <?php if (filter_input(INPUT_POST,'form_tickets')){ if(!empty($_SESSION["tickets"])){ $tickets = array_unique( array_merge(unserialize($_SESSION["tickets"]), filter_input(INPUT_POST, 'form_tickets'))); $_SESSION["tickets"] = serialize($tickets); } else { $_SESSION["tickets"] = serialize(filter_input(INPUT_POST, 'form_tickets')); } echo "<p> Your tickets have been selected!</p>"; } ?> <form method="POST" action=""> <p><strong>Select your ticket(s):</strong><br> Lotto 6/49: <input type="checkbox" value="Lotto 6/49"><br /> Lotto Max: <input type="checkbox" value="Lotto Max"><br /> <p><input type="submit" value="submit"/></p> </form> </body> </html> I honestly don't really know what I'm doing.. This class isn't specifically php so he's going through it too quick for me to grasp/learn. I'm sort of going off examples he's given us but I can't seem to fit the pieces together to make this thing. Again, any help is greatly appreciated I have a vague idea of how it's all supposed to work but not sure of the commands to do it or how to structure it.