Terry1 Posted May 24, 2009 Share Posted May 24, 2009 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/159488-solved-help-with-code-please/ Share on other sites More sharing options...
wildteen88 Posted May 24, 2009 Share Posted May 24, 2009 Change href=" to href=\" Remember if you start your strings with a double quote you'll need to escape all double quotes within your string. Otherwise you'll get the error you're receiving Quote Link to comment https://forums.phpfreaks.com/topic/159488-solved-help-with-code-please/#findComment-841284 Share on other sites More sharing options...
Terry1 Posted May 24, 2009 Author Share Posted May 24, 2009 Is that all? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/159488-solved-help-with-code-please/#findComment-841286 Share on other sites More sharing options...
Cosizzle Posted May 24, 2009 Share Posted May 24, 2009 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/159488-solved-help-with-code-please/#findComment-841292 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.