I am doing a very simple php require statement to include the header on every page of the site.
Code: Select all
<?php require("includes/main-navigation.php"); ?>The form validation is long but here's the relevant bit:
Code: Select all
// Embed error page and dump it to the browser
$fileErrorPage = 'error.php';
if ( $validationFailed == true) {
if ( file_exists( $fileErrorPage) === false) {
echo 'The error page: <b>' . $fileErrorPage . '</b> cannot be found on the server.';
exit;
}
$fileHandle = fopen ( $fileErrorPage, 'r');
$errorPage = fread ( $fileHandle, filesize( $fileErrorPage));
fclose ( $fileHandle);
$errorPage = str_replace( '<!--VALIDATIONERROR-->', $errorList, $errorPage);
echo $errorPage;
exit;
}
// END ERROR VALIDATION SECTION
$fileSuccessPage = 'success.php';
if ( file_exists( $fileSuccessPage) === false) {
echo 'The success page: <b> ' . $fileSuccessPage . '</b> cannot be found on the server.';
exit;
}
$fileHandle = fopen ( $fileSuccessPage, "r");
$successPage = fread ( $fileHandle, filesize( $fileSuccessPage));
fclose ( $fileHandle);
echo $successPage;
exit;