Title: Why does my code crashes WordPress?
Last modified: January 19, 2019

---

# Why does my code crashes WordPress?

 *  Resolved [yellofish](https://wordpress.org/support/users/yellofish/)
 * (@yellofish)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/why-does-my-code-crashes-wordpress/)
 * 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 7 years, 4 months ago by [yellofish](https://wordpress.org/support/users/yellofish/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwhy-does-my-code-crashes-wordpress%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [yellofish](https://wordpress.org/support/users/yellofish/)
 * (@yellofish)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/why-does-my-code-crashes-wordpress/#post-11107116)
 * I found the culprit!
 * My PHP had a `mysql_free_result()` – but that was removed in PHP 7.*
    -  This reply was modified 7 years, 4 months ago by [yellofish](https://wordpress.org/support/users/yellofish/).

Viewing 1 replies (of 1 total)

The topic ‘Why does my code crashes WordPress?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-everywhere_5f7aae.svg)
 * [PHP Everywhere](https://wordpress.org/plugins/php-everywhere/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-everywhere/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-everywhere/)
 * [Active Topics](https://wordpress.org/support/plugin/php-everywhere/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-everywhere/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-everywhere/reviews/)

## Tags

 * [isset](https://wordpress.org/support/topic-tag/isset/)

 * 1 reply
 * 1 participant
 * Last reply from: [yellofish](https://wordpress.org/support/users/yellofish/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/why-does-my-code-crashes-wordpress/#post-11107116)
 * Status: resolved