Java Script Broke

Started by Miker1029, August 22, 2016, 10:43:52 AM

Previous topic - Next topic

Miker1029

Hi All,

   I have recently switched from a Paid host to a VPS, and my error page return to MAIN script countdown broke for some reason, I'm thinking it might be a PHP Setting, But I'm not sure....

What it does is (EXAMPLE) : Error 404, it'll load the page inform the user of the error, and have a Link to Either the Main Page or the Search page on the forum, and a countdown from 10 that will automatically send them to the home page at 0, if you wait for the Countdown it'll sit there and Loop:

"Wainting For *Site*"
"Wainting For *cache*"
"Connecting"
"Wainting For *Site*"
"Wainting For *cache*"
"Connecting"
Etc, Etc.

Here's the pertinent code:

Loaded On Error:


# Error 404 - Page Not Found
case 404:
$errorname = 'Error 404 - Page Not Found';
$errordesc = "<h1>File Not Found</h1>";
// Display selected error message

echo $errordesc;

{

    include ("404error.html");
include ("return.php");
}


404error.html Just Loads Text..


"return.php" Is a Combo of PHP, HTML, and Java Script:


<?php

if (!$referring_url == '') {
echo 
'<p><a href="http://www.android-x86.net" style="color:red"><< Return to Android - X86 Forums Home Page.</a></p>';
echo 
'<p><a href="http://www.android-x86.net/index.php?action=search" style="color:red"><< Or You Can Visit The Android - X86 Search Engiene</a></p>';


else {
echo 
'<p><a href="http://www.android-x86.net" style="color:red"><< Return to Android - X86 Forums Home Page.</a></p>';

echo 
'<p><a href="http://www.android-x86.net/index.php?action=search" style="color:red"><< Or You Can Visit The Android - X86 Search Engiene</a></p>';
}

?>

<p><center>You will be redirected in to Android - X86 Forums Home Page In <span id="counter">10</span> second(s).</center></p>
<script type="text/javascript">
function countdown() {
    var i = document.getElementById('counter');
    if (parseInt(i.innerHTML)<=0) {
        location.href = 'http://www.android-x86.net/';
    }
    i.innerHTML = parseInt(i.innerHTML)-1;
}
setInterval(function(){ countdown(); },1000);
</script>


And yes I'm SURE this could be done WAY more efficiently, But I'm a noob to most "Internet" code, and as I started basic and Assembly Back in the day, I piece it together to get it to work, THEN, When I learn more and can look at it and SAY hmm, This could be BETTER, And takes me 2 Minutes to redo it, Then I Will...LOL

So And Java Guru's out there can help me out with this??  As I said this worked Fine on the Paid Host, and Broke when I went to My VPS...

I'm Running CentOs 7, With PHP 5.6.

Thanks for any help.

Mike



Advertisement: