/    Sign up×
Community /Pin to ProfileBookmark

Parse error: syntax error, unexpected T_STRING

I’m getting this:
Parse error: syntax error, unexpected T_STRING in /home/public_html/uploader.php on line 123
which I believe is this line:

[CODE]move_uploaded_file($_FILES[“file”][“tmp_name”], “upload/” . $newfilename);[/CODE]

from this section of code:

[CODE]$allowedExts = array(“gif”, “jpeg”, “jpg”, “png”);
$temp = explode(“.”, $_FILES[“file”][“name”]);
$extension = strtolower( end($temp) ); // in case user named file “.JPG” etc.!!!

if ( $_FILES[“file”][“size”] < 200000
&& in_array($extension, $allowedExts) )
{
if ($_FILES[“file”][“error”] > 0)
{
echo “Return Code: ” . $_FILES[“file”][“error”] . “<br>”;
} else {
$length = 20;
$randomString = substr(str_shuffle(md5(time())),0,$length);
$newfilename = $randomString . “.” . $extension
move_uploaded_file($_FILES[“file”][“tmp_name”], “upload/” . $newfilename);

$file_location = ‘<a href=”http://www.—–.com/upload/’ . $newfilename . ‘”>’ . $newfilename . ‘</a>’;
}
} else {
echo “Invalid upload file”;
}
$description = $description . ” n ” . $newfilename;[/CODE]

Can you please help me resolve this error?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 26.2014 — Missing semi-colon at the end of the preceding line. (Always a good thing to check for when you get an "unexpected" parse error.)
×

Success!

Help @chrisjchrisj spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.14,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...