Title: Add php within a javascript block.
Last modified: August 19, 2016

---

# Add php within a javascript block.

 *  [HorrorUK](https://wordpress.org/support/users/horroruk/)
 * (@horroruk)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/add-php-within-a-javascript-block/)
 * I have a block of javascript code, and one of the lines shows the following:
 * `a.addVar("movie", "/films/kidnap.flv");`
 * I’m trying to figure out how to add the following line in there, to replace the`"/
   films/kidnap.flv"` section.
 * I am trying to replace it with this:
    `<?php echo get_post_meta($post->ID, 'filmorshow',
   true); ?>` I can’t figure out how to do it though.
 * I did try this, but no luck:
    `a.addVar("movie", "<?php echo get_post_meta($post-
   >ID, 'filmorshow', true); ?>");`
 * Thanks

The topic ‘Add php within a javascript block.’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [HorrorUK](https://wordpress.org/support/users/horroruk/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/add-php-within-a-javascript-block/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
