I have recaptcha and a form on my contact page. Everything has been working (for months) until I had to change out the navigation menu. As soon as I did that, all the PHP etc. code above the "" started displaying at the top of the page. It covers my logo and navbar. What can I do? Can anyone help?
<?php
require( 'recaptcha-master/src/autoload.php' );
$siteKey = '6LcM_wkUAAAAALpmz...';
$secret = '6LcM_wkUAAAAAJO-U04kp...';
$recaptcha = new\ ReCaptcha\ ReCaptcha( $secret, new\ ReCaptcha\ RequestMethod\ SocketPost() );
if ( !empty( $_POST )and isset( $_POST[ 'g-recaptcha-response' ] ) ):
$gRecaptchaResponse = $_POST[ 'g-recaptcha-response' ]; //google captcha post data
$remoteIp = $_SERVER[ 'REMOTE_ADDR' ]; //to get user's ip
$recaptchaErrors = ''; // blank varible to store error
$resp = $recaptcha->verify( $gRecaptchaResponse, $remoteIp ); //method to verify captcha
if ( $resp->isSuccess() ) {
// send mail or insert in db or do whatever you wish to
$headers = 'From: CBS.Website - info@cb.com.';
$emailbody = 'Name: ' . $_POST[ 'name' ] . "\n"
. 'Company: ' . $_POST[ 'company' ] . "\n"
. 'Email: ' . $_POST[ 'email' ] . "\n"
. 'Phone: ' . $_POST[ 'phone' ] . "\n"
. 'Referral: ' . $_POST[ 'referral' ] . "\n"
. 'Stage: ' . $_POST[ 'stage' ] . "\n"
. 'Budget Range: ' . $_POST[ 'budget' ] . "\n"
. 'Geographic Location: ' . $_POST[ 'location' ] . "\n"
. 'Type: ' . $_POST[ 'type' ] . "\n"
. 'Special Considerations: ' . $_POST[ 'considerations' ] . "\n"
. 'Project Type: ' . $_POST[ 'projectType' ] . "\n"
. 'Square Footage: ' . $_POST[ 'sqfootage' ] . "\n"
. 'Number of Stories: ' . $_POST[ 'stories' ] . "\n"
. 'Schedule: ' . $_POST[ 'schedule' ] . "\n"
. 'SF Budget: ' . $_POST[ 'sfbudget' ] . "\n"
. 'Future Construction: ' . $_POST[ 'futureConst' ] . "\n"
. 'Special Features: ' . $_POST[ 'features' ] . "\n"
. 'Restrictions: ' . $_POST[ 'restrictions' ] . "\n";
mail( 'sg@cb.com', 'Contact Form Submission', $emailbody, $headers );
echo "<meta http-equiv='refresh' content=\"0; url=thankyou.php\">";
} else {
$recaptchaErrors = $resp->getErrorCodes(); // set the error in varible
}
endif;
?>
<!doctype html>
<html>
<head>