Alex341 Posted February 27, 2008 Share Posted February 27, 2008 I'm in the last stages of integrating WHMCS However Iam having an issue with PHP include. Heres the existing code: (And yes the div is closed elsewhere ) <div id="header-image" style="background: url('<?php include('./banner.php'); ?>');"> Ive tried many things to get this sorted, various combinations ect but nothing seems to work. Any help appreciated. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 27, 2008 Share Posted February 27, 2008 In Smarty, you use {php} and {/php}, not <?php...?>. Curious why you're trying to use a php file as a background, though. What's up with that? 0 Quote Link to comment Share on other sites More sharing options...
Alex341 Posted February 27, 2008 Author Share Posted February 27, 2008 Ive tried that, no joy Im afraid. Ive also tried {php_include } and {literal} {/literal} Its a rotating banner on a PHP array, hence the background. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 27, 2008 Share Posted February 27, 2008 Tried calling it directly? style="background: url('./banner.php') 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted February 27, 2008 Share Posted February 27, 2008 Ive tried that, no joy Im afraid. Ive also tried {php_include } and {literal} {/literal} Its a rotating banner on a PHP array, hence the background. Your path is more than likely incorrect if its not working. Turn on display errors on that page by adding ?display_errors=on to the url of the page your on It should then show you the php and/or smarty errors. 0 Quote Link to comment Share on other sites More sharing options...
JasonO Posted February 27, 2008 Share Posted February 27, 2008 If the header information is correct, calling it directly as bear said should work. Unless the banner.php output already puts the <img> tags in. Going to a random image script I have directly shows me the image source as its a php file, and my browser has no idea it's an image. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.