02132006 1118 GMT-6
Ok I found the problem but oddly, I have the same error:
This is the code at that line 53:
else { // problem uploading file
print '<p>Your file could not be uploaded because: <b>'; //
// Print a message based upon the error.
switch ($_FILES['thefile']['error']) {
case 1:
print 'The file exceeds the upload_max_filesize setting in the
php.ini.</b></p>';
print '<p>Your file: ' . $_FILES['thefile']['name'] . ' is '. $file_size .
' in size.</p>';
break;
case 2:
print 'The file exceeds the MAX_FILE_SIZE setting in the form.</b></p>';
print '<p>Your file: ' . $_FILES['thefile']['name'] . ' is '. $file_size .
' in size.</p>';
break;
case 3:
print 'The file was only partially uploaded.</b></p>';
break;
case 4:
print 'No file was uploaded.</b></p>';
break;
} // end switch
} // end else
Now, Im not very familar with Switch statements but it
seems very straight forward. However, the error is on
line 53 was a missing backet - but after getting that back
into the code, what prints out for an error is, after
the Your file could not be uploaded because:
there is nothing? I dont see why is the problem.
Wade
Wade Smart wrote:
>02132006 1059 GMT-6
>
>Im working a form for uploading data but I have a problem in this
>structure but I dont see it.
>This structure without all the data works, no errors. But if I put in
>the data I get an error:
>*Parse error*: parse error, unexpected T_ELSE in
>*/var/www/KimTate/AddHome5.php* on line *53
>*That line translates to where the form is to show.
>
>My thinking on this is: if there is no session do something, else go
>forward.
>If addnewhome is not set, show form.
>If addnewhome is set, upload the data.
>
>Another set of eyes and mental process would be much appreciated.
>
>Wade
>
><?php
> // check to see if logged in
> // Start Session
> session_start();
> if (!$_SESSION['author']) {
> }
> else {
> if (isset ($_POST['addnewhome'])) {
> if (move_uploaded_file ($_FILES['thefile']['tmp_name'],
> "/var/www/KT/homes/{$_FILES['thefile']['name']}")) {
> if ($dbc = mysql_connect('localhost', 'user',
> 'pass')) {
> if (mysql_select_db('Homes')) {
> if (mysql_query ($query) ) {
> } else {
> }// end mysql query
> } // end mysql select
> else {
> } // end else mysql select
> } //end dbc
> }
> else { // problem uploading file
> }// end else if move uploaded file
> } // end add new home
> else { // show form *** Error line 53
> } // end show form
> }// end else session
>?>
>
>
>
>[Non-text portions of this message have been removed]
>
>
>
>Community email addresses:
> Post message: [email protected]
> Subscribe: [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
> List owner: [EMAIL PROTECTED]
>
>Shortcut URL to this page:
> http://groups.yahoo.com/group/php-list
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
[Non-text portions of this message have been removed]
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/