Squalls_dreams Posted December 18, 2007 Share Posted December 18, 2007 hello I need some help, this was working before but it isn't now. Ihave a random button code and the problem is when I click on my button, it doesnt bring me to the desired link. All it does is just keep me at the page and the button dissappears. Can someone help me please? here is the code and heres an example. http://johnfisher.myknet.org/bleach/index.php where is says network on the right side. click on the big button. <?php // build an array of affiliate minibanner images $affiliates = array( array( '14.jpg', 'http://johnfisher.myknet.org/' ) ); $rand_affiliate = array_rand($affiliates); $image = $affiliates[$rand_affiliate][0]; $link = $affiliates[$rand_affiliate][1]; print('<a href="' . $link . '"><img src="images/' . $image . '" border="0" alt="" title="' . $link . '" /></a>'); ?> I have it in an iframe by the way. Quote Link to comment https://forums.phpfreaks.com/topic/82215-random-button-help/ Share on other sites More sharing options...
lemmin Posted December 18, 2007 Share Posted December 18, 2007 Either that is old code, or that code isn't being executed on the site you link to. There are no img tags with those properties there. In any case, the reason that the button is disappearing is because it is in an iframe and the link doesn't point to a different target. The web page is, infact, getting loaded, but all you can see is the very top left of it, which is grey; however, since the code for the link is actually on http://johnfisher.myknet.org/bleach/random2.php, that is where the target needs to be changed. If you can, tell whoever manages that site to use the target property on his link in random2.php. I'm not sure there is actually a problem with anything on your page. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/82215-random-button-help/#findComment-417831 Share on other sites More sharing options...
Squalls_dreams Posted January 9, 2008 Author Share Posted January 9, 2008 so wait, how would I get my random buttons to open up in a different window then? is there a way I can insert my random buttons in my webpage without having it in an iframe? cuz I want it too look like how I have it set up now. I figured I'd put my code in the iframe cuz I didn't know of any other way I can show my buttons on my page. please help ??? Quote Link to comment https://forums.phpfreaks.com/topic/82215-random-button-help/#findComment-434529 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.