Title: PHP page includes garbage output
Last modified: August 22, 2016

---

# PHP page includes garbage output

 *  Resolved [DavidSadler](https://wordpress.org/support/users/davidsadler/)
 * (@davidsadler)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-page-includes-garbage-output/)
 * I’m using the Bridge Theme with a fairly complicated PHP script that calls itself
   depending on input parameters (via form and post method called via JS). At the
   top of the form is a switch list and code and then followed by many functions.
   So the code at the top is small compact code with many calls to functions. The
   script builds the page with HTML in a single variable and then does a single 
   echo. The page comes out as expected but at the end of the HTML constructed out
   of the PHP script is a bunch of stuff that is a lot of the PHP script showing
   in text mode and then the Theme footer properly displayed.
 * It almost looks like the output buffer has been loaded with the some of the script
   used to build the page. Do you have any suggestions on how I can debug this one?
   The PHP script runs properly on its own outside of WordPress in a test setup.
 * Is there a way to place some code at the end of PHP code to wait for the output
   buffer to empty before letting the script end?
 * Any help you can offer would be much appreciated.
 * David S.
 * [https://wordpress.org/plugins/insert-php/](https://wordpress.org/plugins/insert-php/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-page-includes-garbage-output/#post-5463275)
 * David, I’ll need to see the code you’re using and try to duplicate the issue 
   on one of my test sites.
 * You may use our contact form at [http://www.willmaster.com/contact.php](http://www.willmaster.com/contact.php)
 * (Insert PHP can’t use a buffer because output is started before the code in Insert
   PHP is being run.)
 * Will
 *  Thread Starter [DavidSadler](https://wordpress.org/support/users/davidsadler/)
 * (@davidsadler)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-page-includes-garbage-output/#post-5463303)
 * Will –
 * Here’s the web site page – [http://dribanklabs.com/?page_id=17643](http://dribanklabs.com/?page_id=17643)
 * If you have problems accessing the web site, send me an email at david(at)sadlerfamily(
   dot)org. The site has restricted access at this point.
 * Use WP 4.0 and Bridge Theme. I’m using an iMac at 10.8.5, Safari Version 6.2 (
   8537.85.10.17.1) and Chrome 38.0.2125.111
 * Another odd thing I noticed is that the prices shown are truncated in all cases
   having eliminated the left two numbers so 499.95 comes out 9.95 and 9.95 comes
   out .95 and so on.
 * And I believe I have auto p turned off. And all editing is done in “Text” mode.
 * Thank you very much for the help. I really appreciate it
 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-page-includes-garbage-output/#post-5463344)
 * This was resolved during a private conversation. The issue was use of the logical
   operator || in the PHP code. See why:
 * [http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#nonworkingelements](http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#nonworkingelements)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP page includes garbage output’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/php-page-includes-garbage-output/#post-5463344)
 * Status: resolved