Title: PHP   EXEC-PHP   Single.php
Last modified: August 19, 2016

---

# PHP EXEC-PHP Single.php

 *  [nash123](https://wordpress.org/support/users/nash123/)
 * (@nash123)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/php-exec-php-singlephp/)
 * I am having a problem with my single.php understanding variables defined in a
   post.
 * For Example:
 * I have made a post using Exec-PHP and include something like
    `<?php $background
   = "yes"; ?>`
 * Then in my single.php I have a code like
 *     ```
       <?php
       if($background == "yes")
       echo "test";
       ?>
       ```
   
 * For some reason the single.php does not understand what the variable $background
   is. Am I doing something wrong?

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/php-exec-php-singlephp/#post-867824)
 *     ```
       <?php
       global $background;
       $background = "yes";
       ?>
       ```
   
 *     ```
       <?php
       global $background;
       if($background == "yes")
       echo "test";
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘PHP EXEC-PHP Single.php’ is closed to new replies.

## Tags

 * [exec](https://wordpress.org/support/topic-tag/exec/)
 * [global](https://wordpress.org/support/topic-tag/global/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [single](https://wordpress.org/support/topic-tag/single/)

 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/php-exec-php-singlephp/#post-867824)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
