PDA

View Full Version : php code in sidebar


mmoore5553
12-24-2011, 02:15 AM
I have a program that manages my ads. I am unable to put code in cms sidebar or forum sidebar.

example

<?php /* Terra Plana VivoBarefoot Athletic (Started 12/10/11) */ @readfile('http://www.wpcreations.net/vbbarefoot/mysimpleads/mysa_output.php?r='.$_SERVER['REMOTE_ADDR'].'&h='.urlencode($_SERVER['HTTP_HOST']).'&rf='.urlencode($_SERVER['HTTP_REFERER']).'&ua='.urlencode($_SERVER['HTTP_USER_AGENT']).'&show_ad=1'); ?>

How do i add this to sidebar to show ads ? I have tried everything. On a normal webpage I am find but vb is not liking this at all.

kh99
12-24-2011, 02:32 AM
For a forum block, make sure you've selected "php" as the content type, then try this code:
/* Terra Plana VivoBarefoot Athletic (Started 12/10/11) */ return @file_get_contents('http://www.wpcreations.net/vbbarefoot/mysimpleads/mysa_output.php?r='.$_SERVER['REMOTE_ADDR'].'&h='.urlencode($_SERVER['HTTP_HOST']).'&rf='.urlencode($_SERVER['HTTP_REFERER']).'&ua='.urlencode($_SERVER['HTTP_USER_AGENT']).'&show_ad=1');



For a CMS widget, make your widget type PHP Direct Execution and use this code:
/* Terra Plana VivoBarefoot Athletic (Started 12/10/11) */ $output = @file_get_contents('http://www.wpcreations.net/vbbarefoot/mysimpleads/mysa_output.php?r='.$_SERVER['REMOTE_ADDR'].'&h='.urlencode($_SERVER['HTTP_HOST']).'&rf='.urlencode($_SERVER['HTTP_REFERER']).'&ua='.urlencode($_SERVER['HTTP_USER_AGENT']).'&show_ad=1');