Sebolains Posted December 7, 2007 Share Posted December 7, 2007 Hi. I have a very simple databse in .txt . I very simply display it in my website. Now: the problem is that I need to display them every 2. I mean: the fisr one must be aligned to the left, the second one to the right, the third one to the left, and so on. How can I do this? There is a lot of aligning involved, not just <align="left">. I figure I have to echo every to entries. How do I do this? Thanks a lot!! Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/ Share on other sites More sharing options...
trq Posted December 7, 2007 Share Posted December 7, 2007 Check out the FAQ/Code snippet repository. Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-408414 Share on other sites More sharing options...
Sebolains Posted December 7, 2007 Author Share Posted December 7, 2007 That wasn't usefull Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-408439 Share on other sites More sharing options...
trq Posted December 7, 2007 Share Posted December 7, 2007 Did you look at this. Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-408454 Share on other sites More sharing options...
revraz Posted December 7, 2007 Share Posted December 7, 2007 It is if you actually read a few threads That wasn't usefull Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-408456 Share on other sites More sharing options...
Sebolains Posted December 7, 2007 Author Share Posted December 7, 2007 :'( I read a lot of stuff but I can't figure out how to apply it. Please if someone could give me a more accurate example, I'd really appreciate it. Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-408494 Share on other sites More sharing options...
trq Posted December 7, 2007 Share Posted December 7, 2007 Lets start with your code. Post what you have and well see if we can turn it into an example. Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-408534 Share on other sites More sharing options...
Sebolains Posted December 7, 2007 Author Share Posted December 7, 2007 OK. Here's the code: <?php $file= 'season1.txt'; $handle = fopen($file, 'r'); $Data = fread($handle, 8192); fclose($handle); $lines=explode("\n",$Data); foreach ($lines as $line) { list($ID, $name, $description, $url)=explode('|',$line); echo '<a href="?p='.$ID.'"><img src="lib/episodes/'.$ID.'.jpg" align="left" border="0"></a><p class="date"><a href="?p='.$ID.'">'.$ID.' - '.$name.'</a></p><p>'.$description.'</p><br>'; } ?> The image has then to be aligned to right, and so should both <p>. Thanks a lot! Sorry if I came out rude. I seriously wasn't. Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-408552 Share on other sites More sharing options...
Sebolains Posted December 8, 2007 Author Share Posted December 8, 2007 So? Is there a way around it? Does anyone know? Link to comment https://forums.phpfreaks.com/topic/80547-problem-with-echo-function/#findComment-409496 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.