
PHP
Create a Web form to help in creating “Jumble” puzzles.
Create a form that has four input fields named Word1, Word2, Word3, and Word4, as well as “Reset” and “Submit” buttons. Create a form processing script that verifies that all four words are entered, that all of them contain only letters, and that all four are between 4 and 7 characters long. Once all of the words have been verified as correct, use the strtoupper() and str_shuffle() functions to produce four jumbled sets of letters.
To create the Jumble Maker form:
1. Create a new document in your text editor. Type the <!DOCTYPE html> declaration, <html> element, header information, and <body> element. The page title should be "Jumble Maker”, add to <title> </title> element.
2. Add the following HTML form tags in the body of the document:
<form action= "process_JumbleMaker.php" method="post">
Word 1: <input type="text" name="Word1" /><br />
Word 2: <input type="text" name="Word2" /><br />
Word 3: <input type="text" name="Word3" /><br />
Word 4: <input type="text" name="Word4" /><br />
<input type="reset" value="Clear Form" />
<input type="submit" name="Submit" value="Send Form" />
</form>
3. Save the document as JumbleMaker.html
4. Create a new document in your text editor. Type the <!DOCTYPE html> declaration, <html> element, header information, and <body> element. The title of the page should be “Jumble Maker”, add to the <title> ... </title> element.
5. Add the opening and closing tags for the PHP script section in the body of the document: <?php ?>
6. Create a function called displayError(). This function displays the error message, and takes two parameters: $fieldName, which is the name of the field as it appears on the Web form; and $errorMsg, which describes the error for the user. There is no return value for this function.
7. Create a second function called validateWord() below the displayError() function. This function takes two parameters. The first parameter, $data, is a string to be validated. The second parameter, $fieldName, is the name of the form field. The function returns the $data parameter after it has been cleaned up. After validating the user input, use the built-in PHP function strtoupper() (Links to an external site.) and str_shuffle (Links to an external site.)() to change all letters to uppercase and shuffle the letters.
8. Immediately after the validateWord() function, declare and initialize a new variable called $errorCount and a new array called $words[] as follows:
$errorCount = 0;
$words = array();
9. Add assignment statements for the $words array variable to receive the output of the validateWord() function for each form field:
$words[] = validateWord($_POST['Word1'], "Word 1");
$words[] = validateWord($_POST['Word2'], "Word 2");
$words[] = validateWord($_POST['Word3'], "Word 3");
$words[] = validateWord($_POST['Word4'], "Word 4");
10. Add a conditional statement immediately after the values of $words have been assigned. This statement will display the total number of errors found or the shuffled words if there were no errors.
if ($errorCount>0)
echo "Please use the \"Back\" button to re-enter the data.<br />\n";
else {
$wordnum = 0;
foreach ($words as $word)
echo "Word ".++$wordnum.": $word<br />\n";
}
11. Save the document as process_JumbleMaker.php.
12. Test the form. It should only show the jumbled results if all four words were entered correctly.

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- Label and Button Widgets. Update the tkhello3.py script so that there are three new buttons in addition to the QUIT button. Pressing any of the three buttons will result in changing the text label so that it will then contain the text of the Button (widget) that was pressed. Hint: you will need three separate handlers or, customize one handler with arguments preset (still three function objects). In pythonarrow_forwardCreate and format a form with multiple field sets Include the following input types: text, date/time, radio buttons, spinners, range sliders, and check boxes Create a selection list Create and format a text area Include at least one input that is set for a mobile keyboard type (e.g. number, email, url, etc.) Validate data with patterns and field lengths Validate data with by having certain fields required Use the focus pseudo class to format valid and invalid selected boxes Include a datalist and use it for input Create a submit and cancel/reset buttonarrow_forwardCreate a lottery game application. Generate three random numbers, each between 0 and 9. • Allow the user to guess three numbers.• Compare each of the user’s guesses to the three random numbers and display a message that includes the user’s guess, the randomly determined three-digit numberarrow_forward
- 1. Create a User Registration Form using the PHP form method. The form should ask the following details from the user: · Name · Username · Password ·Confirm Password 2. Form should have a submit/register and reset button. 3. The program should also display a message that "Registration has been completed".arrow_forwardA blogging website wants users to enroll to get access to the blogs.The figure above shows the form layout for enrollment. Develop a Java WindowBuilder Application to implement this form. Add a Button called "Enroll" at the bottom. When the user clicks this button, the information entered by the user should be displayed in the box called Enrollment information. All the information user entered should be displayed along with their selections indicated by theCheckboxes and Radio Buttons under their proper headings (Interests, Communication Preference, How referred) Example Output:Name: xxxxxxxxxxxxEmail: aaa@bbb.comPhone: 123-456-7890City: zzzzzzzzzzzState: TX Interests Communication Preference How ReferredElectronics email WebsiteTechnologyTravelShoppingarrow_forwardneed help with javaScript Write a statement that displays the variable as: There are 10 objects.arrow_forward
- All controls' attributes influence whether they display on the form during runtime.arrow_forwardUsing Visual Studio, create a C# forms based project Add the following controls: Label (with text, "Enter an Integer"), Textbox, Button (with text, "OK"), and a Lable for output -- Refer to C#FormLayout.PNG Create an eventhandler for the Button, and use a try/catch to ensure the user has entered an integer into the Textbox.arrow_forwardSubmission: Submit python code Problem: Write a python GUI code that can calculate and display Diameter, Area (circle), and Volume based on the input radius. Example: Sphere Attributes Radius 4 Answer 50.265482 Diameter Area Volumearrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





