Re: [PHP] asking comment

2005-04-05 Thread Richard Lynch
On Wed, March 30, 2005 5:44 am, William Stokes said: > I got a bit frustrated with image upload stuff with different image name > problems. So I created a system that gives the uploaded imaged a random > numeric name between 1-10 000 000 and saves the file to a server folder > and > the image name

RE: [PHP] asking comment

2005-03-30 Thread Jared Williams
> JW> If want to create a unique filename, and are using PHP4.3.2 or > JW> better, use fopen() with the 'x' or 'x+' mode, rather than > JW> file_exists(). > > If you're happy with your scripts generating E_WARNING's all > over the place then yes. Personally, I'm not. Use @ to surpress them.

RE: [PHP] asking comment

2005-03-30 Thread Jared Williams
> > I got a bit frustrated with image upload stuff with different > image name problems. So I created a system that gives the > uploaded imaged a random numeric name between 1-10 000 000 > and saves the file to a server folder and the image name to mysql DB. > > Is there a so sort of a problem

Re: [PHP] asking comment

2005-03-30 Thread Frank Arensmeier
Instead of generating filenames with random numbers, why not take a timestamp and use this as filenames? /frank 2005-03-30 kl. 14.44 skrev William Stokes: Hello, I got a bit frustrated with image upload stuff with different image name problems. So I created a system that gives the uploaded image

Re: [PHP] asking comment

2005-03-30 Thread Angelo Zanetti
use a SQL statement to check if that number exists if not then its fine if it does then generate another no and check again, until there is a unique number generated. hope this helps angelo William Stokes wrote: Hello, I got a bit frustrated with image upload stuff with different image name pro

Re: [PHP] asking comment

2005-03-30 Thread Richard Davey
Hello William, Wednesday, March 30, 2005, 1:44:01 PM, you wrote: WS> Is there a so sort of a problem here that I am not thinking of? I WS> only can imagine problem that the rand() gives the same value WS> twice. But I cant see this as a major problem because there would WS> be maybe not more than