TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 192
  • Total: 192

HTML Image Link in PHP

Started by Bardofyouth, May 02, 2010, 07:18:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bardofyouth

I have thoroughly used the search feature here on the forums and I've been wracking my brain on google, perhaps one of you coding legends could fix my code.  I am trying to use the php code to display members within flashchat in a block while also using html to display an image that members can click on to enter the chat room.  here is what I have:

echo "<img src='$home/chat.png'>";

global $boardurl;
echo '
<iframe frameborder="0" height="100" src="', $boardurl, '/chat/info_embedded.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe>';


That much works, it displays an image and uses the php as previously described.  However, when I add the a href part it blows up.  Such as:

echo "<a href="$home/chat/index.php"><img src='$home/chat.png'>";

global $boardurl;
echo '
<iframe frameborder="0" height="100" src="', $boardurl, '/chat/info_embedded.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe>';



What did I get wrong?  Thank you in advance for any and all help!

Bardofyouth

Ahh what a difference an apostrophe makes when used in the place of quotation marks.  I got it, I apologize for the post.

echo "<a href='$home/chat/flashchat.php'><img src='$home/chat.png'>";

global $boardurl;
echo '
<iframe frameborder="0" height="100" src="', $boardurl, '/chat/info_embedded.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe>';

JPDeni


echo "<a href=\"$home/chat/index.php\"><img src='$home/chat.png'>";


Or the way you did it. :)

ccbtimewizard

Better:

echo '<a href="' . $home . '/chat/index.php"><img src="' . $home . '/chat.png">';

This website is proudly hosted on Crocweb Cloud Website Hosting.