jetsettt Posted October 2, 2009 Share Posted October 2, 2009 Can anyone help me out here, it should be straight forward but I am now stuck I am running banner ads on a number of websites sites and all the banner images are stored at my website (http://mybannersite.com/banners/). All the banners are simply coded into the website pages as such... <a href="http://linktothesite.com"><img src="http://mybannersitecom/banners/bannerad-500x75.gif" width="500" height="75"></a> To make all this more manageable, I want to pull all the banners from a database using javascript that calls a PHP page, which is working fine until you add a parameter ?!?! Heres the code (includes 3 PHP files) Javascript code that is added the website to display the banner. (the parameter 'banner' breaks everything) <script type="text/javascript" src="http://mybannersitecom/banner.php?banner=45"> </script> Code in banner.php page <?php include('makejavascript.php'); include('content.php'); ?> Code in makejavascript.php page <?php function ob_makejavascripthandler($output) { return sprintf('document.write(unescape("%s"));', rawurlencode($output)); } ob_start("ob_makejavascripthandler"); ?> Content.php contains the database query. All works fine if a query is used without parameters. When a parameter is added it only outputs 'document.write(unescape(""));' I can't see or drill down any further where this is breaking. I've checked the web server logs and no errors, just the log of the requested url. I think it is the makejavascript.php page that is the problem but I can't make it work. Can anyone help? Thanks Steve Quote Link to comment Share on other sites More sharing options...
jetsettt Posted October 3, 2009 Author Share Posted October 3, 2009 Its started working with parameters now??? Not sure why its started to work, wish I knew, but its working! 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.