Page 1 of 2

-- Parse error index.php on line 145 --

PostPosted: Sun Apr 10, 2011 11:16 am
by Why
I have error
Parse error: syntax error, unexpected $end in htdocs\upload\up\index.php on line 145

Re: Parse error index.php on line 145

PostPosted: Sun Apr 10, 2011 11:23 am
by hiddew
im having the same problem

Re: Parse error index.php on line 145

PostPosted: Sun Apr 10, 2011 1:56 pm
by SamEA
Why wrote:I have error
Parse error: syntax error, unexpected $end in htdocs\upload\up\index.php on line 145


That is indeed odd, are you both on Linux or Windows? What version of PHP are you using? And please provide more details about your server. Furthermore, what code is on line 145?

Re: Parse error index.php on line 145

PostPosted: Sun Apr 10, 2011 2:20 pm
by SamEA
Okay, I have figured out the issue after installing the script from fresh where no such error was shown.

This error is caused when short_open_tag is set to OFF in php.ini. The script throughout has many labels labelled as <? instead of <?php, where <? is referred to as a short open tag. Open php.ini and locate short_open_tag, change the value from Off to On followed by an apache service restart which should solve both of your problems.

Re: -- Parse error index.php on line 145 --

PostPosted: Sun Apr 10, 2011 3:00 pm
by hiddew
solved it, thank you so much!

Re: -- Parse error index.php on line 145 --

PostPosted: Sun Apr 10, 2011 3:10 pm
by hiddew
Also one more question,
I want to customize the entire layout to my own needs, how would I do that? without damaging the uploading

Re: -- Parse error index.php on line 145 --

PostPosted: Sun Apr 10, 2011 3:53 pm
by PeterS
hiddew wrote:Also one more question,
I want to customize the entire layout to my own needs, how would I do that? without damaging the uploading


Create a new folder in ./styles, and copy all the files in Indigo to the new folder. Then modify the footer and header to your own needs. In regards to the styles.css, remove all content apart from the swfupload elements! You may also modify the other files to your own needs.

Goodluck!

Re: -- Parse error index.php on line 145 --

PostPosted: Sun Apr 10, 2011 4:07 pm
by hiddew
Ah thanks, 1 more thing :( where do I find the text in the file upload form?
FileBox is a free file and image hosting service. Feel free to upload your files here! Just browse the files you wish to upload and click on 'Open' when finished selecting the files or on the Upload button if using the HTML form where you will later recieve a download link.
Upload File?

Re: -- Parse error index.php on line 145 --

PostPosted: Sun Apr 10, 2011 7:01 pm
by PeterS
hiddew wrote:Ah thanks, 1 more thing :( where do I find the text in the file upload form?
FileBox is a free file and image hosting service. Feel free to upload your files here! Just browse the files you wish to upload and click on 'Open' when finished selecting the files or on the Upload button if using the HTML form where you will later recieve a download link.
Upload File?


In ./styles/file_upload_form.php, but if you just want to change that line, you can modify it via ./lang/english.php.

If you're a web designer, you could post some modified styles in the styles forum if you want to contribute to the community =).

Re: -- Parse error index.php on line 145 --

PostPosted: Tue Apr 19, 2011 6:52 pm
by tom
Sorry completly wrong topic... please admin move this posting :)

I found the issue!

In my Server Environment it seems that uploads via FLASH are UTF8 Filenames.
HTML Form Uploads are Standard ASCII

So i need to detect if its uploaded via FLASH or HTML

This Line does the job, included decoding:
if ($_GET['method'] == "flash") $filename = utf8_decode($filename);




Code: Select all
$filename = $_FILES['upfile']['name'];
if ($_GET['method'] == "flash") $filename = utf8_decode($filename);
$filename = str_replace("'",'',"$filename");
$filename = str_replace("&",'_',"$filename");
$filename = str_replace("!",'_',"$filename");
$filename = str_replace("@",'_',"$filename");
$filename = str_replace("#",'_',"$filename");
$filename = str_replace("$",'_',"$filename");
$filename = str_replace("%",'_',"$filename");
$filename = str_replace("^",'_',"$filename");
$filename = str_replace("*",'_',"$filename");
$filename = str_replace("(",'_',"$filename");
$filename = str_replace(")",'_',"$filename");
$filename = str_replace("-",'_',"$filename");
$filename = str_replace("+",'_',"$filename");
$filename = str_replace("=",'_',"$filename");
$filename = str_replace("|",'_',"$filename");
$filename = str_replace(" ",'',"$filename");
$filename = str_replace("รค",'ae',"$filename");
$filename = stripslashes("$filename");
$filesize = $_FILES['upfile']['size'];
$fancyurl=rand('1','999');