Page 2 of 2

Re: unexpected T_STRING $_FILES['userfile']['tmp_nam

Posted: Wed Feb 09, 2011 9:09 am
by Weirdan
timoteo wrote:back to matters in hand: this seems to be the source of all problems:

Code: Select all

<?php
if(isset($_POST['upload']) && $_FILES['userfile']['size']>0){
print_r($_FILES['userfile']);
  $fileName = $_FILES['userfile']['name'];
  echo  $fileName;

}
?>
gives
Parse error: syntax error, unexpected T_VARIABLE in /home/biomagn1/public_html/recommendingpeople.com/Untitled-2.php on line 4
Can you attach this file? When replying, select 'upload attachment' tab below the post, choose file. Make sure you pressed 'add the file' button.

Re: unexpected T_STRING $_FILES['userfile']['tmp_nam

Posted: Wed Feb 09, 2011 6:30 pm
by timoteo
Well, got this one working. It was just a matter of retyping everything - no copy and paste - it would seem to put in extra stuff - and triple checking all variable names, ' ' " " etc etc. Thanks for your help everyone - I wouldn't have been able to ask the right questions to myself without help from people like yourselves