Jump to content

inserting php inside php?


karansokhey

Recommended Posts

??? i have no clue im lost at the moment.

im using wordpress and i want to input a php statement inside src for an image but i get this error

 

Parse error: syntax error, unexpected T_STRING in /home/xten/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code on line 1

 

I am using this code.. how do i input the php for post_directory?

 

<?php c2c_get_recent_posts(6, "<li><img src=\"http://www.xtencity.com/wp-content/<?php echo c2c_get_custom('post_directory'); ?>/cover.gif\" class=\"albums-cover\" alt=\"Album Cover\" /><br />%post_URL%</li>"); ?>

Link to comment
https://forums.phpfreaks.com/topic/121120-inserting-php-inside-php/
Share on other sites

I know what you're trying to do:

 


<?php 
$path= c2c_get_custom('post_directory');

c2c_get_recent_posts(6, "<li><img src=\"http://www.xtencity.com/wp-content/".$path."/cover.gif\" class=\"albums-cover\" alt=\"Album Cover\" /><br />%post_URL%</li>"); 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.