Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

Creating a Unique Order ID using ASP

How do I do this using sessions?



3:08 pm on Jul 27, 2003 (gmt 0)

10+ Year Member

Hello all,

I have developed a shopping cart in asp for my client, I have integrated it will a credit card processing gateway called Linkpoint. When a customer makes an order the details are sent to the client email,
there is a unique order id that is generated by linkpoint according to the customers IP address and sent to the client... something like ... now my client would like to have the order id generate according to year, month, day and order of the day, something like : 03-07-26-001.

How do I do this using sessions? or anyother method.

Can anyone help me out?

Thanks in advance!


5:59 pm on Jul 27, 2003 (gmt 0)

10+ Year Member

the simplest way not the most efficient way would be to have a text file that contains the order counter (0001) and increment this counter for every order. Then at the end of every day reset the counter. Obviously you also need a function to format the date the way you want.


1:52 am on Jul 28, 2003 (gmt 0)

10+ Year Member

I'm a little confused, are you saying that Linkpoint is sending an email to the client with that crazy order id but the client would prefer an order id that is based on date?


5:20 am on Jul 28, 2003 (gmt 0)

10+ Year Member

Hi gangstah,

There is a data field "oid" that can be passed from our cart to create the order id ourselves...for example
<input type="hidden" name="oid" value="">

If we are not passing this oid field with a value, Linkpoint creates its own based on the IP of the customer... a long oid as u see.

What my client now requires is create an order id (oid value) based on the year, month, day and order of the day something like...03-07-26-001 from the cart itself (created using ASP) and pass it to Linkpoint, insted of Linkpoint creating its own order id in such length.

Smokin, I am trying out with ur suggession too, somebody told me it can be done using session in asp, making use of global.asp...any idea on that?



5:26 am on Jul 28, 2003 (gmt 0)

10+ Year Member

sorry all it was not global.asp as u know its global.asa lol


3:27 pm on Jul 28, 2003 (gmt 0)

10+ Year Member

joshmachine, You don't need to use sessions if you haven't already used them for your shopping cart. All you need to do is create the order id just before sending the data to Linkpoint.

For example your form data is sent to an asp page that creates the order id, then this is sent (along with your form data) to Link point using either javascript to automate the form post or the following asp object:

Hope that helps ;o)


Featured Threads

Hot Threads This Week

Hot Threads This Month