Here is the error message
Parse error: syntax error, unexpected T_STRING, expecting ']' in D:\UCWS01_data\localuser\UCWS01_197\Finals\BG_FileUploader.php on line 23
Here is the code the message is coming from
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>File Uploader</title>
<meta http-equiv="content-type"
content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
/*This is the php code
for a file uploader*/
//Brian Gagnon
#12/06/2010
$Dir = "files";
if (isset($POST['upload'])) {
if (isset($_FILES['new_file'])) {
if (move_uploaded_file(
$_FILES['new_file']['tmp_name'],
$Dir . "/" . $_FILES['new_file']
['name]) == TRUE) {
chmod($Dir . "/" . $_FILES['new_file']
['name'], 0644);
echo "File \"" .
htmlentities($_FILES['new_file']
['name']]) .
"\"successfully uploaded.
<br />\n";
}
else
echo "There was an error uploading \"".
htmlentities($_FILES['new_file']
['name']) .
"\".<br />\n";
}
}
?>
</body>
</html>
Can someone help me fix the problem?
Parse error: syntax error, unexpected T_STRING, expecting ']' in D:\UCWS01_data\localuser\UCWS01_197\Finals\BG_FileUploader.php on line 23
Here is the code the message is coming from
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>File Uploader</title>
<meta http-equiv="content-type"
content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
/*This is the php code
for a file uploader*/
//Brian Gagnon
#12/06/2010
$Dir = "files";
if (isset($POST['upload'])) {
if (isset($_FILES['new_file'])) {
if (move_uploaded_file(
$_FILES['new_file']['tmp_name'],
$Dir . "/" . $_FILES['new_file']
['name]) == TRUE) {
chmod($Dir . "/" . $_FILES['new_file']
['name'], 0644);
echo "File \"" .
htmlentities($_FILES['new_file']
['name']]) .
"\"successfully uploaded.
<br />\n";
}
else
echo "There was an error uploading \"".
htmlentities($_FILES['new_file']
['name']) .
"\".<br />\n";
}
}
?>
</body>
</html>
Can someone help me fix the problem?