Title: Problem insert_php and shortcode
Last modified: August 22, 2016

---

# Problem insert_php and shortcode

 *  Resolved [dpurselle](https://wordpress.org/support/users/dpurselle/)
 * (@dpurselle)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-insert_php-and-shortcode/)
 * I am trying to integrate WordPress users with Participants Database as described
   on your website: [http://xnau.com/using-participants-database-with-wordpress-users/](http://xnau.com/using-participants-database-with-wordpress-users/)
 * When I insert the shortcode into the page using a PHP plugin, I am getting a 
   Parse error:
 * Code on page:
 * [insert_php]
    echo do_shortcode(‘[pdb_list filter=”user_login=’ . $current_user-
   >user_login . ‘”]’); [/insert_php]
 * Page output:
 * Parse error: syntax error, unexpected T_VARIABLE in /home/content/01/12721101/
   html/CAG/wp-content/plugins/insert-php/insert_php.php(48) : eval()’d code on 
   line 2
 * This occurs with both [pdb_list] and [pdb_record] in several different themes
   and with multiple php plugins. The code works fine if I put it directly into 
   the page template file (although sometimes the formatting is a bit screwy). I
   am experimenting with various themes and would prefer not to rebuild the page
   template files each time I change themes.
 * [https://wordpress.org/plugins/participants-database/](https://wordpress.org/plugins/participants-database/)

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

 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-insert_php-and-shortcode/#post-5264872)
 * Well the code looks good. You may need to declare that global variable before
   you use it:
 * `global $current_user;`
 * But that’s just a guess.
 *  Thread Starter [dpurselle](https://wordpress.org/support/users/dpurselle/)
 * (@dpurselle)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-insert_php-and-shortcode/#post-5264876)
 * That does not change the result.
 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-insert_php-and-shortcode/#post-5264988)
 * Have you tried asking in the support forum for the php shortcode? This is not
   an error generated by the Participants Database plugin.
 *  Thread Starter [dpurselle](https://wordpress.org/support/users/dpurselle/)
 * (@dpurselle)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-insert_php-and-shortcode/#post-5265055)
 * Problem is fixed. There must have been some random characters in the code. When
   I retyped everything from scratch using a text editor, it worked.
 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/problem-insert_php-and-shortcode/#post-5265061)
 * Ah, yes, I should have thought of that…it’s best to do these things in text mode,
   not visual mode.

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

The topic ‘Problem insert_php and shortcode’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

## Tags

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

 * 5 replies
 * 2 participants
 * Last reply from: [Roland Barker](https://wordpress.org/support/users/xnau/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/problem-insert_php-and-shortcode/#post-5265061)
 * Status: resolved