Question

This is about PHP. Create a form that contains a select menu or series of check boxes that allow for multiple sections....

This is about PHP.

Create a form that contains a select menu or series of check boxes that allow for multiple sections. Then, in the handling PHP script, display the selected items along with a count of how many the user selected.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

checkboxes.php

<!DOCTYPE html>
<html>
<head>
<title>PHP: Get Values of Multiple Checked Checkboxes</title>
<link rel="stylesheet" href="css/checkbox.css" />
</head>
<body>
<div class="container">
<div class="main">
<h2>PHP: Get Values of Multiple Checked Checkboxes</h2>
<form action="php_checkbox.php" method="post">
<label class="heading">Select Your Technical Exposure:</label>
<input type="checkbox" name="check_list[]" value="C/C++"><label>C/C++</label>
<input type="checkbox" name="check_list[]" value="Java"><label>Java</label>
<input type="checkbox" name="check_list[]" value="PHP"><label>PHP</label>
<input type="checkbox" name="check_list[]" value="HTML/CSS"><label>HTML/CSS</label>
<input type="checkbox" name="check_list[]" value="UNIX/LINUX"><label>UNIX/LINUX</label>
<input type="submit" name="submit" Value="Submit"/>
<!----- Including PHP Script ----->
<?php include 'count_values.php';?>
</form>
</div>
</div>
</body>
</html>

count_values.php

<?php
if(isset($_POST['submit'])){
if(!empty($_POST['check_list'])) {
// Counting number of checked checkboxes.
$checked_count = count($_POST['check_list']);
echo "You have selected following ".$checked_count." option(s): <br/>";
// Loop to store and display values of individual checked checkbox.
foreach($_POST['check_list'] as $selected) {
echo "<p>".$selected ."</p>";
}
}
else{
echo "<b>Please Select Atleast One Option.</b>";
}
}
?>

checkbox.css

@import url(http://fonts.googleapis.com/css?family=Droid+Serif);
div.container{
width: 960px;
height: 610px;
margin:50px auto;
font-family: 'Droid Serif', serif;
}
div.main{
width: 308px;
margin-top: 35px;
float:left;
border-radius: 5px;
Border:2px solid #999900;
padding:0px 50px 20px;
}
p{
margin-top: 5px;
margin-bottom: 5px;
color:green;
font-weight: bold;
}
h2{
background-color: #FEFFED;
padding: 25px;
margin: 0 -50px;
text-align: center;
border-radius: 5px 5px 0 0;
}
hr{
margin: 0 -50px;
border: 0;
border-bottom: 1px solid #ccc;
margin-bottom:25px;
}
span{
font-size:13.5px;
}
label{
color: #464646;
text-shadow: 0 1px 0 #fff;
font-size: 14px;
font-weight: bold;
}
.heading{
font-size: 17px;
}
b{
color:red;
}
input[type=checkbox]{
margin-bottom:10px;
margin-right: 10px;
}
input[type=submit]{
padding: 10px;
text-align: center;
font-size: 18px;
background: linear-gradient(#ffbc00 5%, #ffdd7f 100%);
border: 2px solid #e5a900;
color: #ffffff;
font-weight: bold;
cursor: pointer;
text-shadow: 0px 1px 0px #13506D;
width: 100%;
border-radius: 5px;
margin-bottom: 15px;
}
input[type=submit]:hover{
background: linear-gradient(#ffdd7f 5%, #ffbc00 100%);
}
Add a comment
Know the answer?
Add Answer to:
This is about PHP. Create a form that contains a select menu or series of check boxes that allow for multiple sections....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PHP you need to create a form to allow the user to enter their name, email,...

    PHP you need to create a form to allow the user to enter their name, email, and address information. That information will be sent to a PHP script that will process and display that information. Your assignment should have two pages. The first page is straight html (user_input.html) that has a form with the appropriate form elements to collect the user input. The form should then be submitted using the POST method to a php script (display_user_info.php) that will process...

  • • Add a menu bar to the program with a File menu. • In the File...

    • Add a menu bar to the program with a File menu. • In the File menu, add a submenu (JMenuItem) called About. • When the user clicks on the About menu item, display a JOptionPane message dialog that contains your name, your course, the section number, and ID. Add comments to the top of each source code file that includes your name, course number, section number, and ID. 2. In Chapter 5, you created a lottery game application. Create...

  • Java: Write an Applet Application to create a menu for a pizza shop. Use check boxes,...

    Java: Write an Applet Application to create a menu for a pizza shop. Use check boxes, radio buttons, and a JButton to allow a customer to make selections and process their order. Use a text area to display the customer's order and the amount due.

  • Your assignment is to create a restaurant ordering system where the cashier can create the menu...

    Your assignment is to create a restaurant ordering system where the cashier can create the menu and then take in the order and display the order back to the customer Sample Execution – Level 1 Welcome to your Menu Creation system. How many items would you like to have on your menu? 2 Create your menu! Enter item #1: Coffee Enter item #2: Tea This is the menu: Coffee Tea What would you like to order? Cake That isn’t on...

  • Create a user friendly interface to order a pizza. Use appropriate controls (radio buttons, list boxes,...

    Create a user friendly interface to order a pizza. Use appropriate controls (radio buttons, list boxes, check boxes) to obtain the type of pizza (e.g. small, medium, large) and the toppings. Calculate the cost of the pizza based upon the size, number of toppings and delivery charge. Display a summary of the order in a text area along with the total cost. Provide buttons which places the order and clears the order. Allow for multiple pizzas to orders Submit as...

  • write a programming code for the following problem using Visual Basic Studio VB. Write a program that will allow the user to enter series of mumbers and will give some useful statistics about the mam...

    write a programming code for the following problem using Visual Basic Studio VB. Write a program that will allow the user to enter series of mumbers and will give some useful statistics about the mambers Enter Numbers Button Click-Allow the user to enter series of nambers using imput dialog boxes. Use a loop and add the numbers to the listBox as they are input.. Prompt the user to enter"x" to stop addang numbers. Compute Statistics Button Click-Compute the following statistics...

  • 1. Print out information of PHP use phpinfo() function. 2. Write a program that check and...

    1. Print out information of PHP use phpinfo() function. 2. Write a program that check and print odd / even numbers (from number 1 to 100 using for/while loop). Display the results within an HTML table with 2 columns as shown below: NUMBERS RESULTS 1 ODD 2 EVEN 3 ODD HINT: use <table> tags to create a table, <th> tags for ‘Numbers’ and ‘Results’. Wrap code PHP inside HTML code. For example: ​<html> ​​<title>CHECK ODD or EVEN</title> ​​<body> ​​​<table> ​​​​<?php...

  • Create an HTML5 page that contains a form to collect the following data. The text in...

    Create an HTML5 page that contains a form to collect the following data. The text in bold indicates the id value that should be assigned to each html control: Product (drop down list) product – iPad, iPhone 6S, Galaxy 5S, Moto X, and so on Quantity (number) quantity Unit price (number) unit_price Discount (%)(number) discount_rate Date (date)   order_date First Name (text box)   first_name Last Name (text box)   last_name Payment type (drop down list)   payment_type – Visa, Master, Discover, Amex, and...

  • This should be in PHP, please For Project 1, you need to create a Web form...

    This should be in PHP, please For Project 1, you need to create a Web form to present a ten (5) Multiple Choice quiz about the Chinese zodiac signs. Indicate that all of the questions must be answered for the quiz to be graded. You can use radio buttons or drop-down boxes Multiple Choice answers. Requirements for Project 1: Provide fields for visitors to enter their name and answers to the questions Notify the visitor that the fields are required...

  • PLEASE INCLUDE SAW-PROMPTS FOR 2 PLAYERS NAMES(VALIDATE NAMES). SHOW MENU (PLAYER MUST SELECT FROM MENU B4...

    PLEASE INCLUDE SAW-PROMPTS FOR 2 PLAYERS NAMES(VALIDATE NAMES). SHOW MENU (PLAYER MUST SELECT FROM MENU B4 THE GAME STARTS 1=PLAY GAME, 2=SHOW GAME RULES, 3=SHOW PLAYER STATISTICS, AND 4=EXIT GAME WITH A GOODBYE MESSAGE.) PLAYERS NEED OPTION TO SHOW STATS(IN A DIFFERNT WINDOW-FOR OPTION 3)-GAME SHOULD BE rock, paper, scissor and SAW!! PLEASE USE A JAVA GRAPHICAL USER INTERFACE. MUST HAVE ROCK, PAPER, SCISSORS, AND SAW PLEASE This project requires students to create a design for a “Rock, Paper, Scissors,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT