Andy Fang Posted August 19, 2013 Share Posted August 19, 2013 Hello Larry, I'm getting this error at my footer.php file here. Basically I try to delete the code happening in line 9, then it says it's happening somewhere else. I delete that part as well, and it says it's happening somewhere else. This is driving me crazy. What do I have to do? I basically want to echo a random string from an array of hundreds of usernames as seen below. I've tried echoing from just $membersf, and it worked just fine. Then when I added a few more strings to the array, suddenly it stopped working. So I split the array up into 3 arrays, and still no luck. What do I do to make this work? <p/> <p/> <p/> <p/> <p/> <?php $membersf = array(andy80,affiliatescraper,BHWbots,AWMarketBot,Jennifer50,seomaster,botwork,promo_guy); $membersf1 = array(seoworld1,Illuminous,socialmediadude,fiverrnuker,botmarket,automationallday); $membersf2 = array (tonial,WillR,Tony Cheng,theSE0,SEOnukeX,Domination King,Nochloss5331,martino1,jasonj,torzilla,vpnnpv); ?> <div class="footer"> <div class="footer_resize"> <table><tr><th>Members Active within Last 30 Minutes (<?php echo mt_rand(11, 35); ?> PRO and <?php echo mt_rand(20, 51); ?> guests)</th></tr></table><table><tr><td><font color="purple"><b>Stev</b></font>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>...</td></tr></table> <br><br> <center> © <?php echo date("Y") ?><a href="http://marketbot.net">MarketBot Niche Finder and Affiliate Marketing Software</a> All Rights Reserved.</a> </center> <br> <div class="clr"></div> </div> <div class="clr"></div> </div> <script> function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "js/full.js"; document.body.appendChild(element); } if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script> <!--[if IE 6]> <script type='text/javascript' src='js/dd_belated_png.js'></script> <script>DD_belatedPNG.fix('.ie6fix');</script> <![endif]--> </body> </html> <body> </html> Link to comment Share on other sites More sharing options...
Larry Posted August 19, 2013 Share Posted August 19, 2013 You have a parse error on line 9. Specifically, you've got a whole lot of text there (i.e., strings) that aren't quoted. 1 Link to comment Share on other sites More sharing options...
Andy Fang Posted August 19, 2013 Author Share Posted August 19, 2013 You have a parse error on line 9. Specifically, you've got a whole lot of text there (i.e., strings) that aren't quoted. Hey Larry, I quoted the strings in the array like so: <p/> <p/> <p/> <p/> <p/> <?php $membersf = array('andy80','affiliatescraper','BHWbots','AWMarketBot','Jennifer50','seomaster','botwork','promo_guy'); <?php $membersf = array('andy80','affiliatescraper','BHWbots','AWMarketBot','Jennifer50','seomaster','botwork','promo_guy'); ?> <div class="footer"> <div class="footer_resize"> <table><tr><th>Members Active within Last 30 Minutes (<?php echo mt_rand(11, 35); ?> PRO and <?php echo mt_rand(20, 51); ?> guests)</th></tr></table><table><tr><td><font color="purple"><b>Stev</b></font>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>...</td></tr></table> <br><br> <center> © <?php echo date("Y") ?><a href="http://marketbot.net">MarketBot Niche Finder and Affiliate Marketing Software</a> All Rights Reserved.</a> </center> <br> <div class="clr"></div> </div> <div class="clr"></div> </div> <script> function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "js/full.js"; document.body.appendChild(element); } if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script> <!--[if IE 6]> <script type='text/javascript' src='js/dd_belated_png.js'></script> <script>DD_belatedPNG.fix('.ie6fix');</script> <![endif]--> </body> </html> <body> </html> But I'm still getting the error. Link to comment Share on other sites More sharing options...
Larry Posted August 19, 2013 Share Posted August 19, 2013 You have two opening PHP tags on subsequent lines. Link to comment Share on other sites More sharing options...
Andy Fang Posted August 19, 2013 Author Share Posted August 19, 2013 Alright, I changed the code to this: <p/> <p/> <p/> <p/> <p/> <?php $membersf = array('andy80','affiliatescraper','BHWbots','AWMarketBot','Jennifer50','seomaster','botwork','promo_guy'); $membersf1 = array('seoworld1','Illuminous','socialmediadude','fiverrnuker','botmarket','automationallday'); $membersf2 = array ('tonial','WillR','Tony Cheng','theSE0','SEOnukeX','Domination King','Nochloss5331','martino1','jasonj','torzilla','vpnnpv'); ?> <div class="footer"> <div class="footer_resize"> <table><tr><th>Members Active within Last 30 Minutes (<?php echo mt_rand(11, 35); ?> PRO and <?php echo mt_rand(20, 51); ?> guests)</th></tr></table><table><tr><td><font color="purple"><b>Stev</b></font>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>, <?php echo $membersf[array_rand($membersf)]; ?>...</td></tr></table> <br><br> <center> © <?php echo date("Y") ?><a href="http://marketbot.net">MarketBot Niche Finder and Affiliate Marketing Software</a> All Rights Reserved.</a> </center> <br> <div class="clr"></div> </div> <div class="clr"></div> </div> <script> function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "js/full.js"; document.body.appendChild(element); } if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script> <!--[if IE 6]> <script type='text/javascript' src='js/dd_belated_png.js'></script> <script>DD_belatedPNG.fix('.ie6fix');</script> <![endif]--> </body> </html> <body> </html> And am getting this error: Parse error: syntax error, unexpected ']' in /home1/vpnmoz/public_html/footer.php on line 19 Link to comment Share on other sites More sharing options...
Recommended Posts