John
Simon
Peter
George
Andy
and the menu would populate as:
-- Employee Name --
JohnSimonPeterGeorgeAndy
when it should populate as:
-- Employee Name --John
Simon
Peter
George
Andy
I have posted the sample code I am using below, could some helpful person point me in correcting this problem, I am using the latest version of PHP on my "localhost" home computer.
Regards
Mike
_________ CODE FOR EMPLOYEE.PHP
<HTML>
<BODY>
<CENTER><H3>Delivery ETC...<BR>
Vote For Employee Of the Month</H3></CENTER>
<FORM METHOD=GET ACTION=get_nomination.php>
<?php
echo (date("[F]"));
if (!$file_op_names = fopen("./tmp/NAMES.txt","r")) {
echo "Sorry I cannot open the file NAMES.txt";
echo "<BR>An error has occurred, please contact the administrator";
exit;
}
if (!$file_op_dept = fopen("./tmp/DEPT.txt","r")) {
echo "Sorry I cannot open the file DEPT.txt";
echo "<BR>An error has occurred, please contact the administrator";
exit;
}
$lines=file("./tmp/NAMES.txt");
echo "<BR><B>Employee Name :<B>";
echo "<SELECT NAME=names >";
echo "<OPTION>-- Employee Name --";
for ($loop=0; $loop < count($lines); $loop++)
{
echo "<OPTION>$lines[$loop]";
}
echo "</SELECT>";
# read from a file and populate a menu
$lines=file("./tmp/DEPT.txt");
echo "<B>Employee Department :</B>";
echo "<SELECT NAME=dept>";
echo "<OPTION>-- Department --";
for ($loop=0; $loop < count($lines); $loop++)
{
echo "<OPTION>$lines[$loop]";
}
echo "</SELECT>";
echo "<BR><BR>";
echo "<B>General Comments</B><BR>";
echo "<TEXTAREA COLS=\"40\" ROWS=\"5\" NAME=\"comment\"></TEXTAREA>";
fclose($file_op_names);
fclose($file_op_dept);
?>
<BR><BR>
<INPUT TYPE="SUBMIT" VALUE="Send me the details !">
<INPUT TYPE="RESET" VALUE="Clear me!">
</FORM>
</BODY>
</HTML>