Secure a unique ID before inserting into DB

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Secure a unique ID before inserting into DB

    Hello,
    I am writing an application to handle support requests, and the user
    needs to have his request number printed out in front of him even before
    he hits the "submit" button. I have no idea how to secure a unique
    number without relying on a database.
    How could this be done ?

    thanks.

    --
    luc wastiaux - email: [email]dustpuppy@airpost.net[/email]

    luc wastiaux Guest

  2. Similar Questions and Discussions

    1. Unique Form inserting into many tables using unique id
      I have a Registration Form that have 3 steps. The data could be inserted into many (4) tables. Some data corresponding to a one table (the main or...
    2. Secure PDF's merged into 1 document from 2 different Secure Files, possible?
      I have multiple Secured PDF files that I have created. There is a possibility that my end user will need to merge multiple PDF files into 1 main PDF,...
    3. secure intranet site with non secure sites?
      I log into a domain open an secure intranet site and then when I go to yahoo.com it messes up my secure intranet site that I have open. Cant...
    4. "Microsoft must deliver 'secure environments' not tools to write 'secure code'" : draft article
      Hello Please see bellow the final draft of an article soon to be published. I would appreciate your comments and corrections of anything that I...
    5. whats the best way to mix secure and non secure data on a page?
      i have an ecommerce site that is split across two domains, a secure space that retains cc details and the main site where contact information and...
  3. #2

    Default Re: Secure a unique ID before inserting into DB

    > I am writing an application to handle support requests, and the user
    > needs to have his request number printed out in front of him even before
    > he hits the "submit" button. I have no idea how to secure a unique
    > number without relying on a database.
    > How could this be done ?
    how about inserting a record before submit? In other words, you have php
    file that displays form to enter request. Before you do anything in that
    file insert a record, and put in some column of it something like
    "finalized='F' ,and then display form now that you know the Id.

    Then when you process submit, just update the existing record, and turn
    "finalized='T'".

    rush
    --
    [url]http://www.templatetamer.com/[/url]



    rush Guest

  4. #3

    Default Re: Secure a unique ID before inserting into DB

    or you can store a number in a file and everytime you need to display the
    page read it, increment it and save the file. Its something like doing page
    view counters.

    sanjay


    "rush" <pipa@rush.avalon.hr> wrote in message
    news:bn32u2$8h6$1@ls219.htnet.hr...
    | > I am writing an application to handle support requests, and the user
    | > needs to have his request number printed out in front of him even before
    | > he hits the "submit" button. I have no idea how to secure a unique
    | > number without relying on a database.
    | > How could this be done ?
    |
    | how about inserting a record before submit? In other words, you have php
    | file that displays form to enter request. Before you do anything in that
    | file insert a record, and put in some column of it something like
    | "finalized='F' ,and then display form now that you know the Id.
    |
    | Then when you process submit, just update the existing record, and turn
    | "finalized='T'".
    |
    | rush
    | --
    | [url]http://www.templatetamer.com/[/url]
    |
    |
    |


    s a n j a y Guest

  5. #4

    Default Re: Secure a unique ID before inserting into DB

    You could base the number on the Unix time stamp. That would always be
    unique (since it's just one long string of seconds since 1970). Then append
    that number with some other identifier (IP address, User ID, etc) Then,
    when they hit "submit", just save it.

    Using that method would also automatically give you the date/time that the
    request ticket was created; all you'd have to do is parse and decode the
    first part of the request ticket.

    Here's a base reference. Look at all the date/time references in the PHP
    manual as well.

    [url]http://www.phpfreaks.com/quickcode/How_to_Generate_a_Unique_ID_for_Order_Tracking_Num bers/17.php[/url]




    Rob


    "luc wastiaux" <dustpuppy@airpost.net> wrote in message
    news:bn2sjn04hm@enews4.newsguy.com...
    > Hello,
    > I am writing an application to handle support requests, and the user
    > needs to have his request number printed out in front of him even before
    > he hits the "submit" button. I have no idea how to secure a unique
    > number without relying on a database.
    > How could this be done ?
    >
    > thanks.
    >
    > --
    > luc wastiaux - email: [email]dustpuppy@airpost.net[/email]
    >

    Rob Guest

  6. #5

    Default Re: Secure a unique ID before inserting into DB

    Rob wrote on Wednesday 22 October 2003 10:07:
    > You could base the number on the Unix time stamp. That would always be
    > unique (since it's just one long string of seconds since 1970). Then
    > append
    > that number with some other identifier (IP address, User ID, etc) Then,
    > when they hit "submit", just save it.
    >
    > Using that method would also automatically give you the date/time that the
    > request ticket was created; all you'd have to do is parse and decode the
    > first part of the request ticket.
    That wouldn't work for simultaneous users who are using a proxy server.
    i.e., if at any point that app was used by 2 or more users simultaneously
    under the same proxy, it would have to use a different logic for generating
    unique IDs.

    One that I've seen and used a lot is similar to (or expanding of) what
    Sanjay suggested with the difference that there's many numbers and they are
    all stored in a database table.

    So, you have a table:
    uniqueid
    ----------
    id

    and a few number records (depending on user load) like:

    150, 151, 152, 153, 154, 155

    When you want a new ID, you grab the lowest ID (150), delete it, and insert
    a new one at the end (156). Sometimes, and depending on database platform,
    it is recommended to use transactions, as well as row-level, page, or table
    locking to handle [rare, depending on the user load] truly simultaneous
    requests.

    This is a brief comment. There are some views and papers published on this
    by experts. I'm sure if the OP searches, he will find some nice ways to
    accomplish this.

    --
    Business Web Solutions
    ActiveLink, LLC
    [url]www.active-link.com/intranet/[/url]
    Zurab Davitiani Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139