chrismassey
Programmer
Hello,
On a new website of mine I have a HTML page which requires/includes 2 PHP scripts, 1 which opens a txt file which lists all the Category links, and another which opens a txt file and lists all the sponsors links.
However, when I view the source code of my website, it isn't as neat as I would like it to be...
For example...
(current source):
(how I would like the source to look like):
By looking at the source code, after each time a variable is printed, it produces a new line afterwards. Note that the word "Documentary" and "Movie" are the products of the variable(s) that are found in the script.
My PHP script for printing the Category links is:
Note that the same issue occurred even when I used no concatenation. How can I stop this and neaten my source code?
Thanks alot,
Chris
On a new website of mine I have a HTML page which requires/includes 2 PHP scripts, 1 which opens a txt file which lists all the Category links, and another which opens a txt file and lists all the sponsors links.
However, when I view the source code of my website, it isn't as neat as I would like it to be...
For example...
(current source):
Code:
<li><img src="Images/LittleTV.bmp"><a href="Categories.php?Category=Documentary
"> Documentary
></a></li><li><img src="Images/LittleTV.bmp"><a href="Categories.php?Category=Movies
"> Movies
></a></li>
(how I would like the source to look like):
Code:
<li><img src="Images/LittleTV.bmp"><a href="Categories.php?Category=Documentary"> Documentary></a></li>
<li><img src="Images/LittleTV.bmp"><a href="Categories.php?Category=Movies"> Movies></a></li>
By looking at the source code, after each time a variable is printed, it produces a new line afterwards. Note that the word "Documentary" and "Movie" are the products of the variable(s) that are found in the script.
My PHP script for printing the Category links is:
Code:
<?php
$path = 'Logs/CategoryLog.txt';
$lines = file($path);
foreach ($lines as $line) {
echo '<li><img src="Images/LittleTV.bmp"><a href="Categories.php?Category=' . "$line" . '">' . " $line>" . '</a></li>';
}
?>
Note that the same issue occurred even when I used no concatenation. How can I stop this and neaten my source code?
Thanks alot,
Chris