Jump to content

What is wrong with this Code?


rookwood

Recommended Posts

<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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.