Jump to content

[SOLVED] Help With Code Please


Terry1

Recommended Posts

I need help with this code.....I keep getting paurse error.

 

Here is the code for the index!

 

 

Thank you all for your help!

 

Terry

 

<?

$bannerCounter= 1;

$bannerCode[$bannerCounter] = "<a href="http://www.cumfiesta.com/main.htm?id=1096425\"><img src=\"http://hostedads.realitykings.com/hosted/banners/image.php?site=cf&size=468x60&rand=19659\"></a>";

$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href="http://www.cumfiesta.com/main.htm?id=1096425\"><img src=\"http://hostedads.realitykings.com/hosted/banners/image.php?site=cf&size=468x60&rand=19659\"></a>";

$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href="http://www.cumfiesta.com/main.htm?id=1096425\"><img src=\"http://hostedads.realitykings.com/hosted/banners/image.php?site=cf&size=468x60&rand=19659\"></a>";

$bannerCounter++;

$bannerAdTotals = $bannerCounter - 1;

if($bannerAdTotals>1)

{

  mt_srand((double)microtime() * 1234567);

  $bannerPicked = mt_rand(1, $bannerAdTotals);

}

else

{

  $bannerPicked = 1;

}

$bannerAd = $bannerCode[$bannerPicked];

?>

 

 

Here is what goes in adverts php

 

<?

include_once("adverts.php");

echo "<div align='center'>$bannerAd</div>";

?>

 

Link to comment
https://forums.phpfreaks.com/topic/159488-solved-help-with-code-please/
Share on other sites

you may also want to try to use single quotes within double quotes (at least thats how I've always done things)

 

// standard URL
$url = "<a href='http://www.example.com' target='_blank'>";

// URL with a variable in the middle
$var = 'click here'
$url2 = "<a href='http://www.example.com' target='_blank'>".$var."</a>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.