Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Move website to another hosting - issues

    Hello,

    I'm trying to move a website to another hosting, but I get some errors and the website won't work, the website was build by someone I cannot reach anymore so I need to solve this issue by myself and of course with your help.
    I think the issue is linked with the path of the files, but not 100% sure. If someone could help me solve my issue, I would really appreciate. Thank you.

    This are the errors:
    Code:
    Deprecated: Assigning the return value of new by reference is deprecated in /home/vol7_5/byethost7.com/b7_15102602/va.likesyou.org/htdocs/__kernel/loader.php on line 80
    Strict Standards: Declaration of php4DOMDocument::dump_node() should be compatible with php4DOMNode::dump_node() in /home/vol7_5/byethost7.com/b7_15102602/va.likesyou.org/htdocs/__kernel/domxml-php4-to-php5.php on line 1
    Fatal error: Call to undefined function session_unregister() in /home/vol7_5/byethost7.com/b7_15102602/va.likesyou.org/htdocs/__kernel/cot.lib.php on line 64
    loader.php:
    PHP Code:
    <?PHP 
    if(!session_id()) session_start();
    $_SESSION['ERROR']=0;
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Expires: " date("r"time()));
    header("Content-type: text/html; charset=windows-1251");


    // defining absolute path
    // for hosting host.md
    function LOADER_DOCUMENT_ROOT($path=false) {
        if (!
    $path) { $path=preg_replace("/\\\\/","/",realpath(dirname(__FILE__))); }
        
    $result=substr($path,-strlen($path),strpos($path,"public_html"))."public_html";
        if (
    $result=="public_html") { $result=$_SERVER['DOCUMENT_ROOT']; }
        return 
    $result;
    }

    $HOST_MD_REAL_PATH=LOADER_DOCUMENT_ROOT();
    include_once(
    $HOST_MD_REAL_PATH."/__config/config.inc.php");
    // check for the existence of settings.php
     
    $need_inst=false;
    if (!
    file_exists($HOST_MD_REAL_PATH."/settings.php"))
    {
        
    $need_inst=true;
    }
    if (@
    filesize($HOST_MD_REAL_PATH."/settings.php")===0)
    {
          
    $need_inst=true;
    }

    if (
    $need_inst)
    {
       
    $inst_txt="<html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>";
       
    $inst_txt.="<title>COT.CMS Version 1.2 - Error: No configuration!</title>";
       
    $inst_txt.="<style>body{font: 84.5% Verdana, Arial, Helvetica, sans-serif;}</style></head><body>";
       
    $inst_txt.="<br><br><center><strong>COT.CMS Version 1.2</strong>";
       
    $inst_txt.="<p><font color='red'>Fatal error: no configuration.</font><br> Reinstall the system.<br>";
       echo 
    $inst_txt; exit;
    }



    if (
    file_exists($HOST_MD_REAL_PATH."/install.php"))
    {
       
    $inst_txt="<html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>";
       
    $inst_txt.="<title>COT.CMS Version 1.2 - Installation is not completed!</title>";
       
    $inst_txt.="<style>body{font: 84.5% Verdana, Arial, Helvetica, sans-serif;}</style></head><body>";
       
    $inst_txt.="<br><br><center><strong>COT.CMS Version 1.2</strong>";
       
    $inst_txt.="<p><font color='red'>Installation is not complete! Delete the file install.php !</font><br>";
       echo 
    $inst_txt;  exit;    
    }


    include_once(
    $HOST_MD_REAL_PATH."/settings.php");

    require_once(
    $HOST_MD_REAL_PATH."/__lang/russian-win-1251_s.inc.php");

    if (
    version_compare(PHP_VERSION,'5','>=')) 

        require_once(
    'domxml-php4-to-php5.php');

    require_once(
    "cot.lib.php");
    require_once(
    "kernel.lib.php");
    require_once(
    "writeresponse.php");

    $XML=domxml_new_doc("1.0");
    $Root=$XML->create_element($GLOBALS['cfg']['XML']['Root']);
    $XML->append_child($Root);
    foreach (
    $GLOBALS['mod'] as $key=>$value

        if (!
    $value['status']) 
        { 
            
    $inc_path=my_getAbsPath($value['Path']);
            if (
    $inc_path
            { 
                require_once(
    $inc_path);
            } 
        } 
    next($mod);

    $DB=&new MySQLClass();
    $DB->openDB($GLOBALS['cfg']['MySQL']['host'],$GLOBALS['cfg']['MySQL']['user'],$GLOBALS['cfg']['MySQL']['password'],$GLOBALS['cfg']['MySQL']['database']);
    if (
    $DB->err)
    {
            
    _catch(1);
    };
    ?>
    cot.lib.php:
    PHP Code:
    <?php 
    function isNum($val)
    {
    (
    preg_match("/^\d+$/",$val)) ? $res=true:$res=false;return $res;
    }
    function 
    c($str_value)
    {
        return @
    iconv("windows-1251","UTF-8",$str_value);
    }
    function 
    my_getAbsPath($path)
    {
        return 
    realpath($GLOBALS['cfg']['Server']['root'].$path);
    }

    function 
    httpGet($var)
    {
        if (isset(
    $_GET[$var])) return trim($_GET[$var]);else return false;
    }

    function 
    httpPost($var)
    {
        if (isset(
    $_POST[$var])) return trim($_POST[$var]);else return false;
    }

    function 
    httpCookie() { }

    function 
    httpSess($var)
    {
        if(isset(
    $_SESSION[$var])) return $_SESSION[$var];else return false;
    }

    function 
    mem_state($var,$sesvar)
    {
        if (
    $var!="")
        {
            
    $_SESSION[$sesvar]=$var;
        }
        elseif (
    httpSess($sesvar)!="")
        {
            
    $var=httpSess($sesvar);
        }
        else
        {
            
    $_SESSION[$sesvar]="";
        }
        return 
    $var;
    }

    function 
    clearSess()
    {
        if(!
    session_id()) session_start();
        
    $_SESSION=array();
        if (isset(
    $_COOKIE[session_name()])) setcookie(session_name(),'',time()-42000,'/');
        
    session_destroy();
    }

    function 
    _catch($flag=0)
    {
        
    $ret=0;
        (
    $flag)?$sessname="_ERROR_":$sessname="_MESSAGE_";
        if (
    httpSess($sessname))
        {
            
    $ret=httpSess($sessname);
            
    session_unregister($sessname);
            unset(
    $_SESSION[$sessname]);
            unset(
    $sessname);
        }
        return 
    $ret;
    }

    function 
    _throw($code=0,$flag=0)
    {
    (
    $flag)?$sessname="_ERROR_":$sessname="_MESSAGE_";
    $_SESSION[$sessname]=$code;
    }

    function 
    getRandomStringN($numchars=8)
    {
        
    $ret="";
        
    $a ="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
        for(
    $i=0;$i<$numchars;$i++) $ret.=substr($a,rand(0,strlen($a)),1);
        return 
    $ret;
    }

    function 
    getRandomString()
    {
        return 
    md5(microtime().rand());
    }
    //date from the database comes as timestamp, returns an array with the date
    function dateFromBase($date)
    {
        
    $ret['year']=date("Y",$date);
        
    $ret['month']=date("m",$date);
        
    $ret['day']=date("d",$date);
        
    $ret['hour']=date("H",$date);
        
    $ret['minute']=date("i",$date);
        
    $ret["second"]=date("s",$date);
        return 
    $ret;
    }
    //comes an array, returns the timestamp
    function date2Base($date)
    {
        
    $ret=time();
        if (
    is_array($date))
        {
            
    $date['year']=(key_exists('year',$date))?$date['year']:date("Y");
            
    $date['month']=(key_exists('month',$date))?$date['month']:date("m");
            
    $date['day']=(key_exists('day',$date))?$date['day']:date("d");
            
    $date['hour']=(key_exists('hour',$date))?$date['hour']:date("H");
            
    $date['minute']=(key_exists('minute',$date))?$date['minute']:date("i");
            
    $date['second']=(key_exists('second',$date))?$date['second']:date("s");
            
    $ret=date("U",mktime($date['hour'],$date['minute'],$date['second'],$date['month'],$date['day'],$date['year']));
        }
        return 
    $ret;
    }
    //check the array with the date
    function checkDateArr($formDate)
    {
        
    $formDate['year']=(isNum($formDate['year']))?$formDate['year']:date('Y');
        
    $formDate['month']=(isNum($formDate['month']))?$formDate['month']:date('m');
        
    $formDate['day']=(isNum($formDate['day']))?$formDate['day']:date('d');
        
    $formDate['hour']=(isNum($formDate['hour']))?$formDate['hour']:date('H');
        
    $formDate['minute']=(isNum($formDate['minute']))?$formDate['minute']:date('i');
        return 
    $formDate;
    }
    ?>


  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    The errors you've posted are PHP errors and look like they're caused by you using a different PHP (newer) version on your new host than your old host.
    You may be able to select an older version of PHP from your Control Panel - otherwise you'll need coding changes to migrate your (old) deprecated code to new.
    Use the W3C HTML Validator and CSS Validator to check your code and Firebug to see what css is applied to an element
    Read Steve Krug's book Don't Make Me Think - essential reading on web usability
    I don't recommend much, but I do recommend Clook for UK web hosting


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •