0

I have ran into a problem and I am unsure where to begin with this. It works on shared hosting, I just purchased DigitalOcean services & installed LAMP on Ubuntu 20.04. I followed the digital ocean guide step by step. My wordpress site works fine and yes I know this code isn't compatible with PHP7, I am hoping to find someone to upgrade it since I don't know too much about code just enough to get me thru usual stuff. I currently have 5.6 installed & working with fastcgi and php5.6-fpm and it works, i can create the phpinfo page and it works fine! But my site won't load it just says:

Error 404 : Page Not Found.'; } } } echo functional($contents); mysql_close(); ?>

Here is the code to index.php which should load all the resources. If you need any more info I can update the post as it goes. Thanks to all who contributes!

index.php:

<?  
session_start();
echo ini_get('session.cookie_domain');
require('functions/functions.php');
db_connect();
date_default_timezone_set(website_configs('wsetime'));
putenv("TZ=".website_configs('wsetime')."");
anty_sql();
if ($_SESSION['islogin'] == 1) {
$listall = mysql_query("SELECT * FROM `users` WHERE `id`='".$_SESSION['id']."'");
$members  = mysql_fetch_array($listall);
$muname=$members['u_name'];
insert_online();
}   
userlogs();
CheckBanned();
UpdatePtc();
$_GET['page'] = strip_tags($_GET['page']);
$couname = get_country('name');
$ispprov = get_country('isp');
$getpage = protect($_GET['page']);    
            if (CheckBlocked('sec_blocklists',$userIp,'ip')){
            $error .=ShowBlockMsg('sec_blocklists','ip');
            }
            if ($couname != ""){
            if (CheckBlocked('sec_blocklists',$couname,'co')){
            $error .=ShowBlockMsg('sec_blocklists','co');
            }}
            if ($ispprov != ""){
            if (CheckBlocked('sec_blocklists',$ispprov,'isp')){
            $error .=ShowBlockMsg('sec_blocklists','isp');
            }}
            if (!CheckMaintenance('maintenance_mode', $userIp)){
            $error .=ShowBlockMaintenance('maintenance_mode');
            }
            
            if ($error){
            $contents = $error;
            }else{
            if ($getpage=='') {
                $gotopage = 'cpages/home'; 
                $contents = file_get_contents($gotopage);
             } else {
             
                if (file_exists('ppages/'.$getpage.'.php')) {
                require_once('ppages/'.$getpage.'.php');  
                } else
                if (file_exists('cpages/'.$getpage)) {
                $contents = file_get_contents('cpages/'.$getpage);
                } else 
                if ((!file_exists('ppages/'.$getpage.'.php')) or (!file_exists('cpages/'.$getpage))) { 
                    $contents ='<h1>Error 404 : Page Not Found.</h1>'; 
                }  
            
            } }
echo functional($contents);
mysql_close();
?>

P.S. - There is no reports in the error.log & no htaccess was ever used in shared nor digitalocean.

  • Plleeeasssee read [Why shouldn't I use mysql_* functions in PHP?](https://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php?noredirect=1&lq=1) – brombeer Apr 06 '21 at 20:34
  • Not my code so I have no choice but to use mysql_* for now. – Jarrod Estepp Apr 06 '21 at 20:35
  • welcome to PHP. `$getpage` find the value for that valuable. that's where the error is set. i seems that value is missing. PLEASE consider using PDO db connection and you have alot of functions that are called. consider using OOP php (classes and objects). Good luck – Dean Apr 06 '21 at 20:47

0 Answers0