1 - function validateInput($data, $fieldName)cfw_ global...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 function validateInput($data, $fieldName){ global $errorCount if (empty($data)) { echo "\$fieldName\" This field is required<br/>\n" ++$errorCount $retval = "" } else { // Only clean up the input if it isn't // empty $retval = trim ($data) $retval = stripslashes($retval) if ($retval=>0) { displayError($fieldName, "Numbers must be more than one") else { \\Display the Web form } return($retval) } if ($errorCount==0) $ShowForm = FALSE else $ShowForm = TRUE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> <html xmlns="http://www.w3.org//1999/xhtml <head> <title>Two Trains Form</title> <meta http-equiv="content-type" content="text/html </head> <body> <?php $DisplayForm = TRUE $distance = "" $distanceA = "" $timeA = "" $speedA = "" $distanceB = "" $timeB = "" $speedB = "" if (isset($_POST['Submit'])){ $distance = validateInput($_POST['distance']) if (is_numeric($distance)){ $DisplayForm = FALSE } $distanceA =
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

1 - function validateInput($data, $fieldName)cfw_ global...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online