Thread: Unique filename

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    22
    Rep Power
    0
    Hello,
    I am using date("U"); to give a unique filename to info
    saved from a form (POST).
    However, every time the page is refreshed a
    new file is created.
    I need something that will give me the name/number once which is then constant for that particular data.
    Any suggestions please. Note This project is my first attempt at PHP.

    ------------------
    With my kind regards,
    Peter.
  2. #2
  3. No Profile Picture
    a total freak
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    33
    Rep Power
    15
    Can you give a preview of your script? it'll really help for further analysis...
    How'd it created a new file everytime the page is refreshed? maybe you should add some query string over the action form, making a condition so it'll add only when the form is submited...

    ------------------
    ---freakyG!---
    kinumedia, web developer
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    22
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by freakyG!:
    Can you give a preview of your script? it'll really help for further analysis...
    How'd it created a new file everytime the page is refreshed? maybe you should add some query string over the action form, making a condition so it'll add only when the form is submited...

    [/quote]Postcard script 1) user chooses pic. 2)and add greeting 3) submits to preview page 4) if OK goes to send.php3
    in here is <? $CardNum=date("U");
    touch("$CardNum");
    ..... .... ?> Idea is to leave file num until last second in case two people on page at same time.
    Of course most people wont go 'back' and repost but this happened whils testing.
    Thankx - Peter
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>in here is <? $CardNum=date("U");
    >>touch("$CardNum");

    Why don't you use "number increment" (should be more unique) instead of "date("U")?
    Like there is a counter with a number starting from 0.

    This is just my little suggestion.

Similar Threads

  1. Replies: 11
    Last Post: March 9th, 2004, 11:46 AM
  2. Python programing newbie needs help
    By SuperDude in forum Python Programming
    Replies: 15
    Last Post: December 6th, 2003, 11:14 AM
  3. not possible to SELECT-WHERE primary key fields?
    By mithril in forum MySQL Help
    Replies: 2
    Last Post: July 18th, 2003, 02:16 PM
  4. Creating a unique Order ID for shopping cart
    By bambam in forum PHP Development
    Replies: 2
    Last Post: February 4th, 2003, 07:26 PM
  5. Replies: 9
    Last Post: October 21st, 2001, 11:32 AM

IMN logo majestic logo threadwatch logo seochat tools logo