dongshu4221 2015-01-22 01:50
浏览 46
已采纳

在PHP中更改BASE URL后的白屏?

We had a script in our site that included a

_BASEURL_

however we needed to change it to https (secure) so we changed the code to:

https://www.domain.com/

However we now get white screen. Below is the code if anyone can help.

    public function getSlideshow() {
    $id_shop = (int)Context::getContext()->shop->id;
    $id_lang = (int)$this->context->language->id;
    $sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'pos_sequence` ps 
        LEFT JOIN `' . _DB_PREFIX_ . 'pos_sequence_lang`  psl ON ps.id_pos_sequence = psl.id_pos_sequence   
        LEFT JOIN `' . _DB_PREFIX_ . 'pos_sequence_shop`  s ON ps.id_pos_sequence = s.id_pos_sequence   
        WHERE s.`id_shop` ='.$id_shop.'  
        AND psl.`id_lang` ='.$id_lang.' 
        AND ps.`active` =1
        ORDER BY `porder` ASC';
    $slides = Db::getInstance()->ExecuteS($sql);

    if(is_array($slides)){
        $limit = 0;
        $arraySlides = array();
        foreach($slides  as $key => $slideArray) {
             //echo "<pre>"; print_r($slideArray); 
            $newSlide = array();
             foreach($slideArray as $k => $v) {

                if($k=='bgimage' ){
                       $v = https://www.domain.com/.'modules/possequence/images/bgimage_'.$slideArray['id_pos_sequence'].'.jpg';
                 }
                 if($k=='image' ){
                       $v = https://www.domain.com/.'modules/possequence/images/image_'.$slideArray['id_pos_sequence'].'.jpg';
                 }
                 if($k=='image2' ){
                       $v = https://www.domain.com/.'modules/possequence/images/image2_'.$slideArray['id_pos_sequence'].'.jpg';
                 }

                 $newSlide[$k] = $v;
             }
             $arraySlides[$key] = $newSlide;
        }

    }
    return $arraySlides;
}

The parts we changed are "bgimage" - "image" and "image2".

展开全部

  • 写回答

2条回答 默认 最新

  • dsvyc66464 2015-01-22 01:57
    关注

    Your PHP-Code is invalid and thus the parser stops with an error. Since your server is set up to not display errors in the frontend (which is good) you just get a white page. You should be able to find the error message in your web server's logs.

    Enclose the three occurences of https://www.domain.com/ with single quotes like so:

    $v = 'https://www.domain.com/'.'modules/possequence/images/bgimage_'.$slideArray['id_pos_sequence'].'.jpg';
    

    Or simply put that part into the already existing string:

    $v = 'https://www.domain.com/modules/possequence/images/bgimage_'.$slideArray['id_pos_sequence'].'.jpg';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部