Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Please help me fix the following error message on line 17 of my php code which is: function validateWord($data, $fileName) { The error message

1. Please help me fix the following error message on line 17 of my php code which is: function validateWord($data, $fileName) {

The error message says:

Parse error: syntax error, unexpected 'validateWord' (T_STRING), expecting '(' in /Applications/XAMPP/xamppfiles/htdocs/Week4/process_JumbleMaker.php on line 17

2. Please help me with code style by surrounding blocs with braces by pointing them out. Add comments in capitals so I see where I missed comments.

There are 2 files in this assignment for the application to run correct. Here are the codes. Error is on File 1.

File 1. process_JumbleMaker.php

Jumble Maker "; ++$errorCount; } $errorCount. $errorCount. function validateWord($data, $fileName) { global $errorCount; if (empty($data)) { displayError($fieldName,"This field is required"); $retval = ""; } else { // Only clean up the input if it isn't // empty $retval = trim($data); $retval = stripslashes($retval); if ((strlen($retval)<4) || (strlen($retval)>7)) { displayError($fieldName,"Words must be at least four and at most seven letters long"); } if (preg_match("/^[a-z]+$/i",$retval)==0) { displayError($fieldName,"Words must be only letters"); } } $retval = strtoupper($retval); $retval = str_shuffle($retval); return($retval); }

File 2: Jumble Maker

No errors on this code but please help me point out stylistic conventions and add comments in capital.

Jumble Maker

Word 1:
Word 2:
Word 3:
Word 4:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

How do you add two harmonic motions having different frequencies?

Answered: 1 week ago