Jump to content

[SOLVED] uploading images through php form


soycharliente

Recommended Posts

add the current time after your image, this way the image never will have the same name and never will be overwritten

 

// 1. seperate the file to: array ( 'file', 'ext' )

// 2. gleu it together using: _123456.

// 3. result: file_123456.ext

 

$file = implode('_'.time().'.', explode('.', $_FILES['uploadname']['name']));

 

// only usable under file.ext condition, if you need a more complicated version pm me

1. nope, you don't have to change the filename, but when it exists it will be overwritten (btw: when using file_exists() results are cached, use clearstatcache() to clear the buffer)

2. time() gives the current time and will never be the same because it keeps counting up... (unless you can time travel)

3. done.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.