Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a timestamp and unique ID to a URL

Status
Not open for further replies.

Rharper03

MIS
Jan 25, 2009
1
Help Please!!!

My organization is using a customer survey tool to collect responses from our staff. We use a tool that allows us to upload a HTML generated template or a Java template and forwards the responder to a asp web interface. We have created the template but would like to create a time stamp and unique identifier for each survey sent out (for monitoring purposes). Giving each responder to each survey a date and Id for future reference and internal auditing purposes.

In the URL I want a unique ID to be generated and for the current date to be produced, but I am uncertain as to how to go about doing this. Getting the template for the general message has been a breeze but coming up with the way to get the date stamp and unique ID brings me here before you! Please if anyone can offer me a lead I would really appreciate it.

Sincerely,

-Rharper
 
If you have access to server-side technology (ASP/PHP etc) then it will be simple - just ask in the appropriate forum forum855, forum333 or forum434.



If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Following up from John's post, you can use server-side code to generate the ID, and either deliver it to the page with the initial form, get it as an AJAX request later on (see forum1600) or set it when the form is posted and return it back to the user as a success screen.

If you really have no access to server-side stuff like this, you could potentially create a new JS Date object and get the number of millis since the epoch. While that would probably be 99% unique, there's a very slim chance that two users could get the same value, so you'd still need to do some checking - and this would have to be server-side, or human-side, if the forms are posted via email, etc.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top