Title: PHP problem when using Gutenberg CUSTOM HTML block
Last modified: April 19, 2023

---

# PHP problem when using Gutenberg CUSTOM HTML block

 *  [Paul Roos](https://wordpress.org/support/users/inetroosgmailcom/)
 * (@inetroosgmailcom)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-problem-when-using-gutenberg-custom-html-block/)
 * The following PHP doesn’t work correctly in the CUSTOM HTML block ..
   <?php**$
   txtstring = “`<div>whatever`” . “`</div>`“;**print $txtstring; ?>However when
   I use **$txtstring = “`<div>whatever`</div>”;**it works perfectly. It must be
   something to do with the concatenation of strings within a CUSTOM HTML code block.
   This is a simplification as I need to concatenate several strings
    -  This topic was modified 3 years, 1 month ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Removed NSFW as this is not that

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

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-problem-when-using-gutenberg-custom-html-block/#post-16666386)
 * The HTML block is only for HTML code – not for PHP code as you write it here.
 * What is the concrete goal of what you want to achieve with it? Maybe it can be
   solved better in a completely different way.
 *  Thread Starter [Paul Roos](https://wordpress.org/support/users/inetroosgmailcom/)
 * (@inetroosgmailcom)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-problem-when-using-gutenberg-custom-html-block/#post-16667993)
 * Thanks for the reply. I want the user of the page, to type in input data and 
   then do a database table query on the server and display the result on the website.
   The database table is not the standard posts etc. of which there many examples.
   It is a table with scheduled time slots, so it is not part of the WordPress database
   structure. In other words, the database table could be any available resource.
   At this stage, it is a lookup only. Maybe later it could be a booking and reservation
   of a resource i.e. update of the “external” database. Maybe a plugin would be
   my solution? Strange enough, the PHP code works for returning a literal constant,
   to the Custom code block (referring to **“`<div>whatever`</div>”** ).
    -  This reply was modified 3 years, 1 month ago by [Paul Roos](https://wordpress.org/support/users/inetroosgmailcom/).
    -  This reply was modified 3 years, 1 month ago by [Paul Roos](https://wordpress.org/support/users/inetroosgmailcom/).
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-problem-when-using-gutenberg-custom-html-block/#post-16668421)
 * You should develop your own plugin for your project. This can realize the processing
   of the entered data as well as the access to the individual database tables. 
   For the integration in the frontend you could use shortcodes, which could also
   control the output. Or you could develop your own Gutenberg blocks, if you want
   it to look “nice” for editors.
 *  Thread Starter [Paul Roos](https://wordpress.org/support/users/inetroosgmailcom/)
 * (@inetroosgmailcom)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/php-problem-when-using-gutenberg-custom-html-block/#post-16669097)
 * Thank you. I was looking for a “quick” solution.

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

The topic ‘PHP problem when using Gutenberg CUSTOM HTML block’ is closed to new 
replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [Paul Roos](https://wordpress.org/support/users/inetroosgmailcom/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/php-problem-when-using-gutenberg-custom-html-block/#post-16669097)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
