Jack Jack - 3 months ago 8
HTML Question

Server Won't Display Body of HTML or PHP

I'm using GoDaddy's CPanel hosting and just finished developing a submission website locally however when I upload it to the server, it won't display the body of the index.php file.

I don't think it has to do with the index.php file because verything works fine locally on localhost with Wamp however my CPanel server will refuse to work. http://submit.arhsj.com/ is where the index.php is. You can see the title of the page has changed and you can Inspect Element to see that the head contains stuff however the body is empty.

Here are the files located in the submit.arhsj.com folder.



I can provide more information if you think it's required. I'm just really confused as to why it's not working when it works perfectly on localhost. Even the HTML form in the middle of the 2 PHP sections won't display.

index.php code:

<!DOCTYPE html>
<html>
<head>
<title>Submission Website</title>
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body>
<?php
require('/recaptcha/src/autoload.php');
require_once "recaptchalib.php";
$siteKey = 'XXXXXXXXXXXXXX';
$secret = 'XXXXXXXXXXXXX';
$lang = 'en';

$response = null; // empty response
$reCaptcha = new ReCaptcha($secret); // check secret key

if (isset($_POST['g-recaptcha-response'])) { // if submitted check response
$response = $reCaptcha->verifyResponse(
$_SERVER['REMOTE_ADDR'],
$_POST['g-recaptcha-response']
);
}

if ($response != null && $response->success) {
echo "Thanks for your submission!";
} else {
?>

<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to submit*:
<input type="file" accept=".gif,.png,.jpg,.jpeg" name="submission" id="submission" required>
<br>Allowed file types: .png .jpg .jpeg .gif
<br><input type="text" name="first_name" id="first_name" placeholder="First Name*" maxlength="56" required>
<br><input type="text" name="last_name" id="last_name" placeholder="Last Name*" maxlength="56" required>
<br><input type="text" name="email" id="email" placeholder="Email Address*" maxlength="128" required>
<br><input type="checkbox" id="rights" value="rights" required>I created this meme or found this meme online but have not changed anything (such as removing watermarks).
<br><input type="checkbox" id="age" value="rights" required>I am 13 years of age or older.

<br><br>By clicking "Submit", you have read, accepted, and agreed to adhere to our Terms of Submission.
<div class="g-recaptcha" data-sitekey="XXXXXXXXXXXXXX"></div>
<input type="submit" value="Submit" name="submit">
<br><br>* Required
</form>

<?php
}
?>

</body>
</html>

Answer

If who post give some answer maybe somebody can help him but here semms become a " last chance" :)

The page is crashed this is sure how is sure that is crashed from the php code.

Maybe the code start with an invisible byte order mark (BOM). So try to open with your editor or notepad++ setting the encoding to UTF-8 (no BOM). Other problem could be the path so the require try in this way and if work you can check the reason.

require $_SERVER['DOCUMENT_ROOT'] . '/recaptcha/src/autoload.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/recaptchalib.php';

Anyway and repeat this point if you post try to follow the reply maybe somebody can help you.