![]() |
| ||
| Parse error, unexpected T_STRING, expecting T_CASE Hello, I am new to Daniweb and am I glad I found it, there is so much helpful information here for a newbie programer. This is my error message: Parse error: parse error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}' in C:\wamp\www\helen\upload.php on line 17 This is my story: I am building a database for a realestate agent and it needs to be able to upload images to the database. Being green at this I have had a heck of a time finding tutorials that make sense to me regarding uploading files to the database so this is what I have done, please tell me if there is a better way. I am using PHP and I have an 'add.php' page where you would fill in your information and there is a browse button to browse to your image file, here is the code for the button, <td><input type="hidden" name="MAX_FILE_SIZE" value="100000" size="32" /> I have another page called 'upload.php' that apparently is the page that processes the file information and places it in the database? (I think this is right?) Here is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">I have been reading posts from others that have been having similar problems and it seems that it is usually a spelling error or a semicolon is missing but I can't seem to find the error. And I am wondering if this is even the right way about uploading images. Incase it is important the information in the data base for the image field is: Field:thumb1 Type:mediumblob Attributes:binary Null:no Thanks for your help, I feel like this php sql stuff will never make sense. Cheers! |
| ||
| Re: Parse error, unexpected T_STRING, expecting T_CASE try the case statements like this: |
| ||
| Re: Parse error, unexpected T_STRING, expecting T_CASE There should be a space between case and 1 and add a newline after the semi-colon as suggested by JeniF .i.e case 1: Also check the type returned by $_FILES['userfile']['error'] and use 1 or '1' accordingly. |
| ||
| Re: Parse error, unexpected T_STRING, expecting T_CASE HI thanks, but that didn't work, I tried it both ways and now my error is: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\helen\upload.php on line 29 Line 29 is: if ($_FILES['userfile']['type'] != 'image/gif''image/jpg') Is this in your opinions the way to upload image files using a browse button? I appreciate your time so far, please don't leave me yet!!! Thanks |
| ||
| Re: Parse error, unexpected T_STRING, expecting T_CASE Your switch problem is fixed. You just have a bug online 29 trie if(strpos('*image/gif image/jpg', $Files[' file1']['type'])) { |
| ||
| Re: Parse error, unexpected T_STRING, expecting T_CASE Thanks but it hasn't worked so far, Here are the new error messages: Uploading file At least I am getting the uploading file message? Any further help is still greatly appreciated. |
| ||
| Re: Parse error, unexpected T_STRING, expecting T_CASE Check the directory permissions in the folder uploads where the file is to be uploaded? |
| All times are GMT -4. The time now is 10:33 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC