NerdieTony Posted November 12, 2016 Share Posted November 12, 2016 Ok, first, here's my code: <?php $img_src = 'http://i.imgur.com/ZRjnZlR.png'; $mouseover_src = 'http://i.imgur.com/GPI0JA5.png'; echo('<a href="#"><img src="' . $img_src . '" onmouseover="this.src=\'' . $mouseover_src . '\'" onmouseout="this.src=\'' . $img_src . '\'" /></a>'); ?> Here's the outcome: http://cheesestatz.com/acnl.php The only problem is, i want to use this link as an image inside the bbcode for another forum [imageee]http://cheesestatz.com/acnl.php[/imageee] But the outcome isn't an image, and i want it to be. The outcome is this: http://prntscr.com/d6c7ql I'm not sure how to make it so the hover image works within the bbcode.... any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/302521-image-hovering-working-with-bbcode/ Share on other sites More sharing options...
requinix Posted November 12, 2016 Share Posted November 12, 2016 Showing us a screenshot of a broken image doesn't really accomplish anything. You've managed to post a small snippet of PHP code demonstrating your image swapping technique, and an example of what kind of BBCode you want to enter into a... whatever you're entering it into. How about posting the code involved in turning that BBCode into HTML markup? And while you're in there, how about giving more detail about that broken image; what URL it has for the src would be a great start. Quote Link to comment https://forums.phpfreaks.com/topic/302521-image-hovering-working-with-bbcode/#findComment-1539246 Share on other sites More sharing options...
NerdieTony Posted November 12, 2016 Author Share Posted November 12, 2016 Showing us a screenshot of a broken image doesn't really accomplish anything. You've managed to post a small snippet of PHP code demonstrating your image swapping technique, and an example of what kind of BBCode you want to enter into a... whatever you're entering it into. How about posting the code involved in turning that BBCode into HTML markup? And while you're in there, how about giving more detail about that broken image; what URL it has for the src would be a great start. Ok, the bbcode tags was changed from to [imageee] so the bbcode can show. The bbcode is support to be img tags html (So basically [imageee]http[/imageee] is <img src="http"></img>, like most messaging boards) The reason i posted that code because is because it's the code for the URL , (http://cheesestatz.com/acnl.php) and how you see the image there, but it's not displaying as an image on forums. Then url in the source is in the php, both images but the main image url is http://cheesestatz.com/acnl.php. I know i want to make it as an image so i'll need to add this header('Content-Type: image/png') but i want it to change images when it's hovered, but i'm not quietly sure how to do that with php, only html. Since i can't use the html and the header together (i believe), so how would i make it work? Quote Link to comment https://forums.phpfreaks.com/topic/302521-image-hovering-working-with-bbcode/#findComment-1539248 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.