Title: Issue with eval
Last modified: August 20, 2016

---

# Issue with eval

 *  [zemq](https://wordpress.org/support/users/zemq/)
 * (@zemq)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/issue-with-eval/)
 * Hello,
 * I have problem with parsing some piece of code in WP index and would like to 
   ask yourself for help. I tried to solve it and was googling some kind of solution
   for last few days but with no result.
 * So the issue is that I tried to create post pattern which uses custom fields 
   through php commands. For parsing php code I use Exec-php plugin for WP.
    On 
   my index, where you can find only first parts of posts, there is showing parsing
   error – [look here](http://www-hodinky-guess.ic.cz/). But on post itself there
   is no error and whole post is shown in a way it was supposed to be – [look here](http://www-hodinky-guess.ic.cz/hodinky-guess-guess-w11562g4/).
   So the first strange conclusion is that the same code is interpreted in different
   way on index.php and on single.php. I changed themes twice, but error is still
   there.
 * Here is 10 lines of post pattern code in which is (most likely) some error:
 *     ```
       1/ <div class="hlavicka">
       2/ <div class="head-vlevo">
       3/ <img class="uvodni" title="<?php echo get_post_meta(get_the_ID(), 'komplet', true);?>" src="<?php echo get_post_meta(get_the_ID(), 'imgurl', true);?><?php include (ABSPATH . 'php/str_komplet_img.php');?>.jpg" height="250px" alt="<?php echo get_post_meta(get_the_ID(), 'komplet', true);?>" />
       4/ </div>
       5/ <table class="tabulka">
       6/ <tbody>
       7/ <tr>
       8/ <td style="text-align:left; width:74%;">Nyní:</td>
       9/ <td style="text-align:right; width:25%; font-weight:bold;"><a href="<?php include (ABSPATH . 'php/url.php'); ?><?php include (ABSPATH . 'php/str_komplet.php'); ?><?php include (ABSPATH . 'php/html.php'); ?><?php include (ABSPATH . 'php/id.php'); ?>" target="_blank"><?php echo get_post_meta(get_the_ID(), 'akce', true); ?></a></td>
       10/ </tr>
       ```
   
 * Error (according to what error message says) is on line 3, but I can see nothing
   wrong there. On the other hand if I delete line 3 then parsing is OK on single.
   php and also on index.php – no error in this case. In my opinion line 3 and 9
   are very similar and are correct so I really don´t understand why line 3 is not
   interpreted the same way as line 9 is. Included file is also OK.
 * Another file mentioned in error message is runtime.php from Exec-php plugin and
   here´s the part of it that is connected to error (specifically line 42):
 *     ```
       37/ function eval_php($content)
       38/	 {
       39/	 	 // to be compatible with older PHP4 installations
       40/		 // don't use fancy ob_XXX shortcut functions
       41/ 	 ob_start();
       42/	  eval (" ?> $content <?php " );
       43/ 	$output = ob_get_contents();
       44/		ob_end_clean();
       45/		return $output;
       46/	}
       ```
   
 * There´s maybe something missing in that line (semi-colon, slash or whatever),
   because from that line the file stop colorize syntax when in editor. So I ask
   anybody who´s good at php to correct either my code on line 3, or runtime.php
   on line 42 or bring some other solution to solve my issue.
 * Thanks
    greenmouse
 * _[ [Please refrain from bumping](http://codex.wordpress.org/Forum_Welcome#No_Bumping).]_

The topic ‘Issue with eval’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [zemq](https://wordpress.org/support/users/zemq/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/issue-with-eval/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
