kevdoug Posted July 20, 2006 Share Posted July 20, 2006 Hi I am trying to display images with the image title with a table but I can't get them in line. I would like the title either above or below the image. All I get at the moment is the title to the side of the image. I have the code below. [color=red]echo "<tr>"; echo "<td>"; echo "<a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'>"; echo "</td>"; echo "</tr>"; I have tried [color=red]echo "<br />";[/color] and [color=red]echo "\n";[/color] here but niether works. echo "<tr>"; echo "<td>"; echo OCIResult($stmt,'TITLE'); echo "</td>"; echo "</tr>";[/color] Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/ Share on other sites More sharing options...
effigy Posted July 20, 2006 Share Posted July 20, 2006 The br will put the break in the browser; \n will put the break in the source. Is a br tag with 2 spaces before the slash valid? Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61132 Share on other sites More sharing options...
king arthur Posted July 20, 2006 Share Posted July 20, 2006 You haven't closed the anchor tag, e.g. with[code]</a>[/code]after the img tag. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61134 Share on other sites More sharing options...
trq Posted July 20, 2006 Share Posted July 20, 2006 This has very little to do with php. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61135 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 i had to add the 2 spaces or the post took it as a break and would not display it. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61136 Share on other sites More sharing options...
treilad Posted July 20, 2006 Share Posted July 20, 2006 Worked fine for me, but I echoed it all in one piece.[quote]<?phpecho "<table><tr><td><a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'><br /><br /></td></tr><tr><td>Title</td></tr></table>";?>[/quote] Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61138 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 [quote author=thorpe link=topic=101273.msg400564#msg400564 date=1153413900]This has very little to do with php.[/quote]its with the php code? Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61140 Share on other sites More sharing options...
treilad Posted July 20, 2006 Share Posted July 20, 2006 [quote author=thorpe link=topic=101273.msg400564#msg400564 date=1153413900]This has very little to do with php.[/quote]He's not hurting anybody. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61143 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 [quote author=treilad link=topic=101273.msg400568#msg400568 date=1153414010]Worked fine for me, but I echoed it all in one piece.[quote]<?phpecho "<table><tr><td><a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'><br /><br /></td></tr><tr><td>Title</td></tr></table>";?>[/quote][/quote]I am echoing the [color=red]TITLE[/color] as a colum from the table. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61148 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 [quote author=king arthur link=topic=101273.msg400563#msg400563 date=1153413806]You haven't closed the anchor tag, e.g. with[code]</a>[/code]after the img tag.[/quote] thanks but closing the img tag has no effect. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61152 Share on other sites More sharing options...
treilad Posted July 20, 2006 Share Posted July 20, 2006 Yes, I know. But since I don't have that table I just used text. Have you tried mine, substituting your code in? Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61154 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 [quote author=treilad link=topic=101273.msg400585#msg400585 date=1153414953]Yes, I know. But since I don't have that table I just used text. Have you tried mine, substituting your code in?[/quote]Yes your code works but when I replace the TITLE for colum TITLE retrieved from the table it goes back to the side. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61172 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 [quote author=treilad link=topic=101273.msg400585#msg400585 date=1153414953]Yes, I know. But since I don't have that table I just used text. Have you tried mine, substituting your code in?[/quote]I've managed to get it to work with the title under the image thanks. The only prolem now is that they are in a single colum down the page instead of across the page in a row. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61180 Share on other sites More sharing options...
HeyRay2 Posted July 20, 2006 Share Posted July 20, 2006 Can you link the page you are creating so we can see exactly what you are seeing? Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61183 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 [quote author=HeyRay2 link=topic=101273.msg400615#msg400615 date=1153417113]Can you link the page you are creating so we can see exactly what you are seeing?[/quote]The sites not live yet. Is there a way to insert a screen shot? Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61193 Share on other sites More sharing options...
wildteen88 Posted July 20, 2006 Share Posted July 20, 2006 Use the img code:[code][img]img-url-here[/img][/code] tags, if you want to place a screen shot Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61195 Share on other sites More sharing options...
king arthur Posted July 20, 2006 Share Posted July 20, 2006 Better to view the source in your browser and cut and paste the code here. Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61196 Share on other sites More sharing options...
kevdoug Posted July 20, 2006 Author Share Posted July 20, 2006 [quote author=wildteen88 link=topic=101273.msg400629#msg400629 date=1153417971]Use the img code:[code][img]img-url-here[/img][/code] tags, if you want to place a screen shot[/quote]The img tag aren't working or at least I can't see the image in preview. but this is what I am getting. The code is also below. >:( angry :( sad :'( cry This is what I get >:( :( :'( angry sad cry This is what I would likeAny way I hope you get the idea. [color=red] while (OCIFetch($stmt)) { $img = OCIResult($stmt,'IMAGE'); $titl = OCIResult($stmt,'TITLE'); echo " <table> <tr> <td><a href=". $img ." target='new'><img src=' " . $img . "' height='75' width='100'></a>; </td> </tr> <tr> <td> $titl </td> </tr> </table>"; }[/color] Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61216 Share on other sites More sharing options...
king arthur Posted July 20, 2006 Share Posted July 20, 2006 You still aren't closing the <a> tag - IE will take this to mean the entire rest of your table is part of the link.Try something like[code]$img = OCIResult($stmt,'IMAGE');$titl = OCIResult($stmt,'TITLE');echo "<table><tr><td><a href=" . $img . " target='new'><img src='" . $img . "' height='75' width='100'><br />" . $titl . "</a></td>\n";echo "<td><a href=" . $img . " target='new'><img src='" . $img . "' height='75' width='100'><br />" . $titl . "</a></td>\n";echo "<td><a href=" . $img . " target='new'><img src='" . $img . "' height='75' width='100'><br />" . $titl . "</a></td></tr></table>\n";[/code] Link to comment https://forums.phpfreaks.com/topic/15170-the-use-of-or-n/#findComment-61247 Share on other sites More sharing options...
Recommended Posts