• Resolved yellofish

    (@yellofish)


    WP: 5.0.2
    PHP: recently updated 5.6 > 7.2

    My code suddenly creates problems. When I save the page wordpress crashes und I get a text only page with zero style elements – like you open a text page in your browser.

    One the frontend the page renders – but the side panel is missing.

    I found the backend troublemaker, but I wonder why.

    Bad code:

    <?php
    if(isset($_POST['imodel'])){ $mod = $_POST['imodel']; } ELSE {$mod = 'iPhone Xs'; $linkinsert ='iphone-xs';}
    if(isset($_POST['imemory'])){ $mem = $_POST['imemory']; } ELSE {$mem = '64';}
    
    if(isset($_POST['curr_option'])){$curr_option = $_POST['curr_option']; } ELSE {$curr_option = 'USD';}

    Changed and working in backend:

    <?php
    if(!empty($_POST['imodel']) || !empty($_POST['imemory'])){
        $mod = 'iPhone Xs'; $linkinsert ='iphone-xs'; $mem = '64';
    }
    
    if(isset($_POST['curr_option'])){$curr_option = $_POST['curr_option']; } ELSE {$curr_option = 'USD';}

    However, in the frontend the side-panel still disappears on reload.

    Need to add that the bad code did run in PHP 5.6 (or previous WP version) without problem.

    • This topic was modified 6 years, 1 month ago by yellofish.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter yellofish

    (@yellofish)

    I found the culprit!

    My PHP had a mysql_free_result() – but that was removed in PHP 7.*

    • This reply was modified 6 years, 1 month ago by yellofish.
Viewing 1 replies (of 1 total)
  • The topic ‘Why does my code crashes WordPress?’ is closed to new replies.