Incorrect PHP syntax class & nbsp; Images {var & nbsp; $ inputName; & nbsp; & nbsp; & nbs PHP incorrect syntax
Class Images {
Var $ inputName; // control name
Var $ allowType = array (
'Image/GIF', 'image/jpg ', 'image/jpeg', 'image/png ', 'image/x-png', and 'image/pjpeg'
); // Upload type
Var $ allowSize = 2097152; // limit the size
Var $ saveDir = $ _ SERVER ['document _ root']. "/upfiles/user"; // Save the Directory
Var $ isRename = true; // whether to rename. the default value is true.
Var $ errID = 0; // error code. the default value is 0.
Var $ errMsg = ""; // error message
Var $ savePath = ""; // save path
Var $ saveDir = $ _ SERVER ['document _ root']. "/upfiles/user"; // Save the Directory
Is this write error? How should I write it?
Share:
------ Solution --------------------
The attribute cannot be an unknown value in the class definition.
You can assign values in the constructor.
Class Images {
Var $ saveDir;
Function Image (){
$ This-> saveDir = $ _ SERVER ['document _ root']. "/upfiles/user"; // Save the Directory
}