Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/82215-random-button-help/
Share on other sites

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!

Link to comment
https://forums.phpfreaks.com/topic/82215-random-button-help/#findComment-417831
Share on other sites

  • 3 weeks later...

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 ???

Link to comment
https://forums.phpfreaks.com/topic/82215-random-button-help/#findComment-434529
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.