I have a script wich should work but doesn't.
It keeps saying :
Parse error: parse error, unexpected '<' in /home/virtual/site185/fst/var/www/html/leden/uplf.php on line 64
And when i looked at the script i didn't finded anything.
So i tryed to make the code a bit more understandible .
Adding some enters.
I executed it again but still the same error.
WIERD.
Code :
<?php
session_start();
include 'header.php';
if ($_POST['deleteFile']) {
for ($i=0;$i<count($_POST['deleteFile']);$i++) {
if (is_file($_POST['deleteFile'][$i])) {
unlink($_POST['deleteFile'][$i]);
}
}
echo "<meta http-equiv=\"refresh\" content=\"0; URL=uplf.php?".SID."\">";
}
if($_SESSION['user_level'] == 1)
{
$dir = "../gallery/";
}
else if($_SESSION['user_level'] >= 2)
{
$dir = "../".$_SESSION['user_name']."/";
}
$arrExclude = array("Image2_1x2.gif");
$arrInput = array();
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while ($file = readdir($dh)) {
if (in_array($file,$arrExclude))
continue;
$strFile = $dir."/".$file;
$arrInput[] = is_dir($strFile) ? "" :
?>
<tr>
<td width="20%">
<?php
if($_SESSION['user_level'] >=2)
{
?>
<input type="checkbox" value="
<?php
echo $strFile;
?>
" name="deleteFile[]">
<?php
}
?>
</td>
<td width="80%">
<font color="yellow"><b>
<?php
echo $file;
?>
</b></font></td></tr>
<?php
}
closedir($dh);
}
}
?>
<form method="post" action="
<?php
echo "uplf.php?".SID;
?>
">
<div align="center">
<table border="0" cellspacing="1" width="400">
<tr>
<td width="10%" bgcolor="Yellow"><b></b></font></td>
<td width="90%" bgcolor="Yellow"><b>filenaam</b></font></td></tr>
<?php
echo implode('',$arrInput);
?>
</table>
<?php
if($_SESSION['user_level'] >= 2)
{
?>
<input type="hidden" name="deleteFiles" value="1">
<font size="1">Aangekruiste vakjes worden gedelete</font>
<input type="submit" value=" Delete " onClick="return confirm('Zeker weten ?')">
</form>
<?php
}
?>
<form action="
<?php
echo "uplf.php?".SID;
?>
" method="post" enctype="multipart/form-data">
<font size="1">Upload hiet je plaatjes (A.U.B niet meer dan 500 kb).</font>
<input type=file name=userfile size=30><br>
<input type=submit value=" Submit ">
</form>
<?php
if ($_FILES["userfile"])
{
$tmpfile = $dir.$_FILES["userfile"]["name"];
if(!file_exists($tmpfile))
{
move_uploaded_file($_FILES['userfile']['tmp_name'], $tmpfile);
}
echo 'Bezig met het opslaan van de file variablen . .......';
echo "<meta http-equiv=\"refresh\" content=\"0; URL=uplf.php?".SID."\">";
}
include 'footer.php';
?>