I don't quite understand how you display the images.
What i after is a seperate page where it displays the images and you can flick through them using an next buton. Idealy I would like it so you could also say how much you like the image with maybe 1-10 using radios, a bit like hot or not.
If anyone can tell me how to do any part of this it would be much apreciated!
I don't quite understand how you display the images.
What i after is a seperate page where it displays the images and you can flick through them using an next buton. Idealy I would like it so you could also say how much you like the image with maybe 1-10 using radios, a bit like hot or not.
If anyone can tell me how to do any part of this it would be much apreciated!
Can anybody help me with this? I'd also like the images to be diplayed in a random order if that is possible?
a seperate page where it displays the images and you can flick through them using an next buton. Idealy I would like it so you could also say how much you like the image with maybe 1-10 using radios, a bit like hot or not.
Your question is not really connected to image uploads. For maximum coverage it would probably be best if you started a new thread.
from reading this thread i have taken from it that id have to send the images from the uploaded folder to a database before i could actually display them on a web page.. is this correct?
also... why does the code add 1155116715- to the start of my image name once ive uploaded it?
from reading this thread i have taken from it that id have to send the images from the uploaded folder to a database before i could actually display them on a web page.. is this correct?
The database is just used to keep a record of what images are in the upload directory and is just an extra.
Originally Posted by popcop
also... why does the code add 1155116715- to the start of my image name once ive uploaded it?
That was just an example used in this script to ensure a unique file name.
Hi, I'm trying to get this to show the uploaded files but no matter what I try it will only show one file name, over and over.
like xxx.jpg, xxx.jpg instead of xxx.jpg, yyy.jpg
here is what I've done to the processor page to get there, but i'm stuck, any ideas?
PHP Code:
// make a unique filename for the uploaded file and check it is
// not taken... if it is keep trying until we find a vacant one
foreach($active_keys as $key)
{
$now = time();
while(file_exists($uploadFilename[$key] = $uploadsDirectory.$now.'-'.$_FILES[$fieldname]['name'][$key]));
$uploadFilenames[$key] = $now.'-'.$_FILES[$fieldname]['name'][$key];
{
$now++;
}
}
// now let's move the file to its final and allocate it with the new filename
foreach($active_keys as $key)
{
@move_uploaded_file($_FILES[$fieldname]['tmp_name'][$key], $uploadFilename[$key])
or error('receiving directory insuffiecient permission', $uploadForm);
}
Hi,
Give the folder's permission 777 in FTP.
Or entering into the cpanel->Files->www->Upload Folder--> Change the permission as 777.
Then you can do it.
$file__name="john.doc";
move_uploaded_files($HTTP_POST_FILES(['file']['tmp_name']),'upoad_Files'.$filename);
Do it like this way.
Thank you so much! I kept trying to do it through the public_html folder instead of the www folder....
www and public_html are just two differnt server set up optiong, Nothing to do with PHP Each can ber differnt with no difference to web operation.
My server is /hosting/index.php......
Hi, if you want to keep things simple, why are you adding radio buttons for the days of the week? Why can't you use time()?
That's bokeh's -the original coder- idea.
I probably didn't understand properly. Is there a method that Bokeh has suggested?
Let's say you have 7 jpegs on your server. Let us say you want to overwrite the one on the server named 'tuesday.jpg'. If I wanted to upload a picture that was already called file.jpg, I would like the option either by radio buttons or a drop down list to change the name of the file being uploaded - so it overwrites the one on the server.
Those imges are the ones being pulled in via XML into Flash for example.
Does this make sense?
This is probably an over simplified way of doing it - is there a better, more conventional way?
In your form file do a radiogroup like this:
<label><input type="radio" name="weekDay" value="Monday">Monday</label>
<label><input type="radio" name="weekDay" value="Tuesday">Tuesday</label>
<label><input type="radio" name="weekDay" value="Wednesday">Wednesday</label>
etc...
get that value in your uploadProcessor file: $weekDay = $_POST['weekDay'].;
After you do all the checks on the original file you re-name it in two steps:
1) You need to know the extension of the file =>to get it susbstract the 4 las characters of the original file. ('.jpg' or '.gif') and for example you call it $extension.
2) re-name it:
$uploadFilename = $uploadsDirectory.$weekDay.$extension
What I'm not sure is how you do the overwriting because in my case when I try to upload a file that already exists, it gives me problems. In that case, what I suggest you to do is to: a) find the existing matching file, b) re-name it, c) upload the new file.
Bookmarks