on Mon, 26 Aug 2002 20:37:22 GMT, Soheil Shaghaghi wrote: > I want to sell a service. > I have a form where the user comes to purchase the service. > I can get the date from SQL database in any format and display it in > form. > > At this point, when the user fills out the form and submits it, I > want to look at the date. > If the date is before August of 2002, the price should be set to > $25.00, and if it's after August of 2002, it will be $50.00
You may want to consider returning the date in two formats from your SQL query. One for comparing and one for displaying. If you take the format 'yyyymmdd', the comparison is easy: if ($date lt '20020801') { $price = 25; } else { $price = 50; } You may also want to consider working in cents instead of dollars, to avoid rounding errors. -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]