rookwood Posted July 2, 2010 Share Posted July 2, 2010 <html> <head> <title>Browns - Design Needs</title> <link type="text/css" rel="stylesheet" href="style.css"> <link rel="SHORTCUT ICON" href="favicon.ico"/> <!--PHP News Finder--> <?php $file = 'news.txt'; $data = file ($file) or die ('Could Not Read News File.'); $lines = count (file ($file)) - 1; str_replace ("<title>", " ", $data[1]); $line = 2; while ($lines > $line) { str_replace ("<story>", " ", $data[$line]); $line = $line + 1; } $line = 2; while ($lines > $line) { $story = $story + $data [$line]; $line = $line + 1; } $neweststory['title'] = $data[1]; $neweststory['story'] = $story; ?> </head> <body> <div id="header"> </div> <div id="nav"> <ul> <li><span><a href="#">Home</a></span></li> <li><a href="#">About</a></li> <li><a href="#">Links</a></li> <li><a href="#">Resources</a></li> </ul> </div> <div id="main"> <div id="main_text"> <h2>Home</h2> <p> Hello this is Browns Design the site for designs. </p> </div> <div id="side_news"> <h2>News</h2> <div id="box"> <h3><?php echo $neweststory['title']; ?></h3> <?php echo $neweststory['story']; ?> </div> </div> </div> </body> </html> There's something wrong with this code and I can't work out what, I'm a bit of a beginner so please help. It doesn't throw an error so its not that bad but it doesn't work still. You can see it in action here: http://sadler-designs.cwahi.net/Simple/ Thanks In advanced, Alex Link to comment https://forums.phpfreaks.com/topic/206541-what-is-wrong-with-this-code/ Share on other sites More sharing options...
kenrbnsn Posted July 2, 2010 Share Posted July 2, 2010 What is the problem? What is it supposed to do? What is it doing? Ken Link to comment https://forums.phpfreaks.com/topic/206541-what-is-wrong-with-this-code/#findComment-1080372 Share on other sites More sharing options...
rookwood Posted July 2, 2010 Author Share Posted July 2, 2010 Its supposed to display the text in the file with separated title and story bits which have there tags removed Link to comment https://forums.phpfreaks.com/topic/206541-what-is-wrong-with-this-code/#findComment-1080388 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.