I have a very simple PHP script that is is to upload single file... <?php try{ $uploaddir = $_GET['dir']; $uploadfile = $uploaddir . basename($_FILES["file"]["name"]); move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile); echo "Success: " . $_FILES["file"]["name"] . "; }catch (Exception $e){ echo 'Boo Boo!: '.$e->getMessage(); } ?> PHP: The error is on the second last line 'syntax error, unexpected T_STRING, expecting ',' or ';'... If I don't echo back the error message, but a simple 'Hello', I get a $end error instead. I have no idea why and I also have no real idea about PHP... If the Try Catch block is removed, it works fine. I am using PHP5. Any ideas?
Replace echo "Success: " . $_FILES["file"]["name"] . "; PHP: with echo "Success: " . $_FILES["file"]["name"]; PHP: - ads2help