I would like to start by saying that your code is horribly confusing. Try taking all those commented out parts out of the script before you post to the group.
That said, your problem is that you left out a closing curly brace. Try this: > global $MYFILES; > $MYFILES['file_recensione']['tmp_name'][1] = 'image/pjpeg'; > if ($MYFILES['file_recensione']['tmp_name'][1] == 'image/pjpeg') {print "OK > HERE<HR>";} > print "VALUE 0:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>"; > if (/*is_uploaded_file($MYFILES['file_recensione']['tmp_name'][1])*/ > //($VAL == 1) && ( > ($MYFILES['file_recensione']['type'][1] == 'image/jpeg') || > ($MYFILES['file_recensione']['type'][1] == 'image/pjpeg') || > ($MYFILES['file_recensione']['type'][1] == 'image/gif') > // ) > ) { > $EXTGIF = 'jpg'; > if (substr($MYFILES['file_recensione']['type'][1], -3) == 'peg') { > $EXTGIF = 'jpg';} > if (substr($MYFILES['file_recensione']['type'][1], -3) == 'gif') { > $EXTGIF = 'gif';}} // ******ADDED CLOSING BRACE******* > print "ESTENSIONE = $EXTGIF;<BR>"; > } else {print "UPLOAD > FAILED<BR>".$MYFILES['file_recensione']['type'][1].";<BR>";} > print "VALUE =1:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>"; Mweb <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > Hello, > > I can't understand why the piece of test code below produces the output : > OK HERE > VALUE 0:image/pjpeg; > UPLOAD FAILED = ; > VALUE =1:image/pjpeg; > > Basically I use or print several times the value > $MYFILES['file_recensione']['tmp_name'][1] > and it looks like it changes values from line to line (it's not a scope > thing, I'm almost sure in this case: what is below is the whole file). Look > at the line below with the string "ESTENSIONE", it should be printed instead > of UPLOAD FAILED, right? > Why doesn't it happen? > > mweb > //////////////////////////////////////////////////////////////////////////// ////////////////////// > global $MYFILES; > $MYFILES['file_recensione']['tmp_name'][1] = 'image/pjpeg'; > if ($MYFILES['file_recensione']['tmp_name'][1] == 'image/pjpeg') {print "OK > HERE<HR>";} > print "VALUE 0:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>"; > if (/*is_uploaded_file($MYFILES['file_recensione']['tmp_name'][1])*/ > //($VAL == 1) && ( > ($MYFILES['file_recensione']['type'][1] == 'image/jpeg') || > ($MYFILES['file_recensione']['type'][1] == 'image/pjpeg') || > ($MYFILES['file_recensione']['type'][1] == 'image/gif') > // ) > ) { > $EXTGIF = 'jpg'; > if (substr($MYFILES['file_recensione']['type'][1], -3) == 'peg') { > $EXTGIF = 'jpg';} > if (substr($MYFILES['file_recensione']['type'][1], -3) == 'gif') { > $EXTGIF = 'gif';} > print "ESTENSIONE = $EXTGIF;<BR>"; > } else {print "UPLOAD > FAILED<BR>".$MYFILES['file_recensione']['type'][1].";<BR>";} > print "VALUE =1:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]