Question:
Parse error: syntax error in PHP?
2
2012-05-29 18:42:58 UTC
i get this error:Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in F:\Xampp\htdocs\video.php on line 3


code:

$ path = "videos/";
$path = $path . basename( $_FILES['videofile']['name']);
if(move_uploaded_file($_FILES['videofile']['tmp_name'],

$path{echo "Successful upload of ". basename( $_FILES['videofile']['name']);

} else{

echo "Error when uploading the video.";

}

?>
Four answers:
Ryuk
2012-05-29 18:46:41 UTC
change



$ path = "videos/";



to



$path = "videos/";
Ratchetr
2012-05-29 18:46:44 UTC
Maybe get rid of the space between the $ and the variable name in this line?:

$ path = "videos/";
2016-05-17 06:59:50 UTC
you missed a "dot" (concatenation operator): "\t" $password should be: "\t" . $password EDIT: PS: in php you should only use double quotes if you're going to use variable substitution like this: $form_data = "$firstName\t$lastName\t$email\t$userNam... which is cleaner (and maybe faster) for this line than using concatenation else you should use single quotes.
Caligurl(:
2012-05-29 18:43:20 UTC
google it


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...