Forum Moderators: coopster
<?php include("http://www.example.co.uk/ads/468banner.txt");?>
which enters the text verbatim into the coding. I want to have a variable so that on each site I can make the retrieved code have one alteration. I know this doesn't work but here is the direction I wanted to go:
<?php include("http://www.example.co.uk/ads/468banner.txt", $banner); $banner = str_replace ("this text", 'other text' $banner);?>
does that make sense? My coder abondoned me near the end of a project (I was stupid enough to pay upfront) and my coding isn't that great as you can see!
If that's the case reference this function in your include file instead of the .txt file, leave the default text used most often declared in the function and do this:
function banner_swap($text = "default text here") {
$banner_code = 'Here is the code for the banner, blah, blah, blah'.
'and here is the text to change '.$text.' and here is more'.
'code blah blah blah';
echo $banner_code;
}
Put the function reference in your pages instead of the include:
banner_swap("change me"); //-> new banner text
- or -
banner_swap(); //-> stick with the default