Hello everyone,
I'm trying to get up to speed in PHP and I am encountering a problem with my php code.
On my webserver, I have a php code file that reads the contents of a parameter text file, parses it into table variables, and uses that to display a dynamic menu :
This code works, I have thoroughly debugged it.
My problem is as follows : when I include this code into a regular HTML file, all of a sudden it doesn't work any more.
This is my HTML code :
What am I doing wrong ?
I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
I'm trying to get up to speed in PHP and I am encountering a problem with my php code.
On my webserver, I have a php code file that reads the contents of a parameter text file, parses it into table variables, and uses that to display a dynamic menu :
Code:
Contents of start.php :
<?php
$options[0]="";
$files[0]="";
$arraynum=0;
function getoptions(){
global $options, $files, $arraynum;
$input="";
$ficlist=file("pagelist.dat");
foreach($ficlist as $input){
$tab=explode("-",$input);
$options[$arraynum]=$tab[0];
if($arraynum==0){
$files[$arraynum]="home.php";
}else{
$files[$arraynum]=$tab[1].".php";
}
$arraynum++;
}
}
getoptions();
echo "<table>";
echo "<tr><td colspan='2' style='width:796px;background:#3c6a50;'><br/><br/></td></tr>";
echo "<tr><td style='width:200px;' valign='top'>";
echo "<ul id='menu'>";
$iter=0;
for($iter=0;$iter<$arraynum;$iter++){
echo "<li class='selected'><a href='".$files[$iter]."' >".$options[$iter]."</a></li>";
}
echo "</ul>";
?>
This code works, I have thoroughly debugged it.
My problem is as follows : when I include this code into a regular HTML file, all of a sudden it doesn't work any more.
This is my HTML code :
Code:
<html>
<head>
<title>Mini projet NFA053</title>
<link rel="stylesheet" type="text/css" href="./style.css" title="fichier1">
</head>
<body>
<!--#include FILE="start.php" -->
</body>
</html>
What am I doing wrong ?
I've got nothing to hide, and I'd very much like to keep that away from prying eyes.