deployment issue

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?

<?php // instantiate it here $userInfoForm = new UserInfoForm(); class UserInfoForm { // ---------------------------------------------------------------------------- // constructor // ---------------------------------------------------------------------------- function UserInfoForm() { // process form if (isset($_POST['stage']) && ('process' == $_POST['stage'])) { // $this->processForm(); } else { $this->displayHeader(); $this->displayForm($formValues); // *** ERROR HERE $this->displayFtpInfo(); } } // ---------------------------------------------------------------------------- // print first part of page // ---------------------------------------------------------------------------- function displayHeader() { echo <<<END

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 out the errors and form variables foreach ($fields as $field => $field_name) { // open row echo '
'; // print error if (!empty($errors[$field])) { echo $errors[$field]; } else { echo ' '; // to prevent odd looking tables } echo " "; } echo '
'; echo '
'; } } // end class ?>

There is probably a difference on the error reporting level in the php.ini file. You might want to verify that.

Sponsor our Newsletter | Privacy Policy | Terms of Service