Atari ST fan
Posts: 8
52 credits Members referred : 0
« on: Aug 04, 2006, 07:17:51 PM »
Hi,
I'm very new to php, so perhaps I'm jumping in the deep end. Never-the-less, I'm not sure how to actually get this Easy PHP Upload to work on my website. Using the code I always get:
Notice: Undefined index: upload in */PHPdirectory/* on line 125 Notice: Undefined index: upload in */PHPdirectory/* on line 126 Notice: Undefined index: upload in */PHPdirectory/* on line 127
Which are the stared lines of this code respectively.
Code:
if (isset($_POST['Submit']) && $_POST['Submit'] == "Upload") { 1$foto_upload->the_temp_file = $_FILES['upload']['tmp_name']; * $foto_upload->the_file = $_FILES['upload']['name']; * $foto_upload->http_error = $_FILES['upload']['error'];1 * $foto_upload->replace = (isset($_POST['replace'])) ? $_POST['replace'] : "n"; // because only a checked checkboxes is true $foto_upload->do_filename_check = "n"; if ($foto_upload->upload()) { $foto_upload->process_image(false, true, true, 80); $foto_upload->message[] = "Processed foto: ".$foto_upload->file_copy."!"; // "file_copy is the name of the foto" } }
When I use the upload_example.php I don't get any errors, but it doesn't upload anything either.
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6352
38936 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Aug 04, 2006, 08:59:16 PM »
what is the upload form you are using? (only the code between the form tags)
That's the page where users will be able to upload pictures.. It isn't correctly linked from the rest of the website yet which is about to have a major update to it.
Have I got it set up to use a Database? Because I haven't created a database for it to use..
« Last Edit: Aug 08, 2006, 08:10:11 PM by HailandKill »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6352
38936 credits Members referred : 374
It's time to use PHP5!
« Reply #9 on: Aug 09, 2006, 12:55:22 AM »
No there is no database needed, I used your file on my local server without changes and it worked fine.
You are saying that the orgininal example is working on this server? please show me this file too (just change the pathes for the upload)
While the upload_example doesn't give any errors, new pictures appear to be uploaded into the directory.
I have PHP Version 4.4.2 installed.. not sure whether that's a problem. More server info can be found at www.yumc.co.uk/info.php
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6352
38936 credits Members referred : 374
It's time to use PHP5!
« Reply #11 on: Aug 09, 2006, 09:02:28 AM »
I can't see what is the problem:
Quote
While the upload_example doesn't give any errors, new pictures appear to be uploaded into the directory.
it doesn't work for me
after the upload there must be an success message.
EDIT: one is strange here, this is what I get if I upload with you modified version: Notice: Undefined index: upload in /usr/local/home/httpd/vhtdocs/yumc.co.uk/uploadphp.php on line 125
Notice: Undefined index: upload in /usr/local/home/httpd/vhtdocs/yumc.co.uk/uploadphp.php on line 126
Notice: Undefined index: upload in /usr/local/home/httpd/vhtdocs/yumc.co.uk/uploadphp.php on line 127
While the upload_example doesn't give any errors, new pictures appear to be uploaded into the directory.
it doesn't work for me
That was actually a typo for me.. I meant to say new pictures don't appear.
Those were also the errors that I got. All I can think of now is that there is something wrong with the PHP on my server. I don't suppose if I'd have my php.ini file configured incorrectly things would go wrong..? Although a phpBB forum works happily on the same forum.
That was actually a typo for me.. I meant to say new pictures don't appear.
Those were also the errors that I got. All I can think of now is that there is something wrong with the PHP on my server. I don't suppose if I'd have my php.ini file configured incorrectly things would go wrong..? Although a phpBB forum works happily on the same forum.