Try this:
PHP Code:
<?php
if ($style == "oblivionstyle") {
$adcolour="#000000";
}
if ($style == "hexstyle") {
$adcolour="#000000";
}
if ($style == "mainstyle") {
$adcolour="#012349";
}
if ($style == "") {
$adcolour="#012349";
}
?>
<script type="text/javascript"><!--
google_ad_client = "pub-1527442551569821";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "012349";
google_color_bg = "<?php echo $adcolour; ?>"
google_color_link = "012349";
google_color_text = "000000";
google_color_url = "00CCFF";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
You were echoing the string "$adcolour" instead of the variable $adcolour. If you had used double-quotes ("$adcolour") it would have also worked, but you used single-quotes ('$adcolour') which will not get the variable's value.
Bookmarks