PDA

View Full Version : Php trouble


ezek
10.31.05, 12:07 PM
My php knowledge is very very basic as you can see from these scripts. Im trying to allow users to upload files to my server and to appear in a gallery. The gallery section i have sorted. But its the two scripts i have written to upload the images. One is a upload.php and the other is getfile.php.

i get this when i try and upload Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/*******/public_html/getfile.php on line 8

Here is the code for getfile.php
<html>
<head>
<title>Process Uploaded File</title>
</head>
<body>
<?php
if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
****** ""http://www.************.com/uploads/{$_FILES['uploadFile'] ['name']}")* )
***** {* print '<p> The file has been successfully uploaded </p>';
****** }
else
***** {
******* switch ($_FILES['uploadFile'] ['error'])
******** {* case 1:
****************** print '<p> The file is bigger than this PHP installation allows</p>';
****************** break;
*********** case 2:
****************** print '<p> The file is bigger than this form allows</p>';
****************** break;
*********** case 3:
****************** print '<p> Only part of the file was uploaded</p>';
****************** break;
*********** case 4:
****************** print '<p> No file was uploaded</p>';
break;
******** }
****** }
?>
</body>
</html>

Milky
10.31.05, 12:48 PM
Based on my quick look at it, it appears that it is because you have to "" right nect to eachother on line 8

So, instead of being, ****** ""http://www.************.com/uploads/{$_FILES['uploadFile'] ['name']}")* )


Try

****** "http://www.************.com/uploads/{$_FILES['uploadFile'] ['name']}")* )

ezek
10.31.05, 01:06 PM
Parse error: parse error, unexpected '\"' in /home/********/public_html/getfile.php on line 8 now i get this, thank you for trying tho

5ive Dee
11.01.05, 07:11 PM
replace the second " with a ' maybe

ezek
11.02.05, 04:53 PM
lol still doenst work, i think il just re-write it see what happens thanks for every ones help.
ezek

liamegan
11.02.05, 11:25 PM
can we see the script without the stars?

ezek
11.03.05, 04:14 PM
every time i copy and paste it the stars appear

ezek
11.03.05, 04:15 PM
iv kinda given up going to re-write it again and see it i can get it to work. Thanks for the help.