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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

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

Post 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.
timoteo
Forum Contributor
Posts: 125
Joined: Sat Jan 08, 2011 6:46 am

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

Post 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
Post Reply