RESOLVED - just with a careful retype and check of all variables. It would appear my editor was pasting in extra characters as well with copy and paste.
thanks a lot for all your help and pointing in the right direction.
Yes you are right - most of my problem is trying to figure out which page to open the dictionary - to try and figure out what the problem is. The error I have posted in full above.
Now I know that I can populate the array above - all is well. Infact retyping out the examples got much further...
I got the jpg up now. So all is good here. this still gives error... Something wrong with variables??
<?php
if(isset($_POST['upload']) && $_FILES['userfile']['size']>0){
print_r($_FILES['userfile']);
$fileName = $_FILES['userfile']['name'];
echo $fileName;
}
?>
back to matters in hand: this seems to be the source of all problems:
<?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...
ok got it working now
Array
(
[name] => code_640340_1.txt
[type] => text/plain
[tmp_name] => /tmp/phpQOIGee
[error] => 0
[size] => 429
)
however if I try to upload anything bigger - small photo it doesn't sent.
Well I can't see the error codes as I can not display a page I just get -
Parse error: syntax error, unexpected T_STRING in /home/biomagn1/public_html/recommendingpeople.com/ya.php on line 11
It would seem that whenever it sees tmp_name it throws the above error
Thanks for checking this out. Yes as far as I can see there is no problem with the php - that's what makes it more frustrating. What sort of thing can I look for in my php? I am using php5.2.11 on a remote server. file uploads is on, upload_tmp_dir has no value which from what I have read...
I have tried several variations of a file upload script but all give me an unexpected T_STRING error with $_FILES['userfile']['tmp_name']. Does anyone know why this might be?
For example - from this same page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.