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!! Quote Link to comment Share on other sites More sharing options...
trq Posted December 7, 2007 Share Posted December 7, 2007 Check out the FAQ/Code snippet repository. Quote Link to comment Share on other sites More sharing options...
Sebolains Posted December 7, 2007 Author Share Posted December 7, 2007 That wasn't usefull Quote Link to comment Share on other sites More sharing options...
trq Posted December 7, 2007 Share Posted December 7, 2007 Did you look at this. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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.