I developed a website on my computer, the same machine being both server and client.
It all works fine. Now it is being deployed and they get a PHP error when trying to display a page with a form on it, so I suspect it is some sort of configuration error. I can’t debug it because I am located far away.
The error is:
Notice: Undefined variable: formValues in …userinfoform.php
Code is below.
What can I tell the people deploying it to look for?
Bla bla bla
END; } // ---------------------------------------------------------------------------- // print form for user info // ---------------------------------------------------------------------------- function displayForm() { $token = md5(uniqid(rand(), true)); // these needs to be outside of the tag, otherwise it causes a parse error $file = $_SERVER['PHP_SELF']; $firstName = $_POST['firstName']; // remember values filled in the form $lastName = $_POST['lastName']; // when redisplaying the form with errors $email = $_POST['email']; // currently don't remember radio button values // start html with "here document" syntax echo <<<END
First Name: | |
Last Name: | |
Email: |
END; // end html } // ---------------------------------------------------------------------------- // print info on how to ftp // ---------------------------------------------------------------------------- function displayFtpInfo() { echo <<<END
Bla bla bla
END; } // ---------------------------------------------------------------------------- // output a message // for debug // ---------------------------------------------------------------------------- function outputMessage($msg) { echo $msg; echo '
'; } // ---------------------------------------------------------------------------- // display errors results from input into form // ---------------------------------------------------------------------------- function displayErrors ($errors) { $fields = array('firstName' => 'firstName', 'lastName' => 'lastName', 'email' => 'email'); if (count($errors)) { echo ''; echo 'Please correct the errors in the form:'; echo ''; } echo '
'; // print error if (!empty($errors[$field])) { echo $errors[$field]; } else { echo ' '; // to prevent odd looking tables } echo " | "; } echo ' |
'; } } // end class ?>