Okay, I am new to VBScript, so go easy on me.
I have this webpage that has a form on it that collects data from a user; The typical name, address, etc.
However, the form also requires the user to choose which hotel they want to go to. (they are in drop down menu's). You hit submit then it goes to another page which pulls all the information together and also gives you a price tag.
The costs for all the hotels are in the dbm file. So when you select "whatever hotel" and hit submit, it will go into the dbm file, find "whatever hotel" find its price and then place that in the 2nd page (where you confirm the details).
Okay, that I have got working fine, but the problem lies in the fact that there is a SECOND price that needs to be ADDED to the hotel price.
Lets say for example that the user also selects a tour guide that costs $250. The information is in the database; so how to get the script to add the tour guide price and the hotel price for the confirmation page?
I'm not entirely sure, but I think this portion of the code is the bit I have to change:
if (chk1 <> 0 or chk1 <>"") then
cost_st = chk1 * cost1
else
cost_st = 0
end if
if (chk2 <> 0 or chk2 <>"") then
cost_nd = chk2 * cost2
else
cost_nd = 0
end if
if (rc_reg <> 0 and temp <> 0) then
fee_rate = objrsreg("fee_rate")
cur_type = objrsreg("cur_type")
reg_amount = cost_st + cost_nd
reg_amount = (reg_amount + (no_reg * fee_rate))
At the moment, this piece of code just does the hotel price, (no_reg is actually the number of people going to the hotel, so if the user puts in 2, it will be the cost of the hotel X 2 which is why it says "no_reg * fee_rate".
I have this webpage that has a form on it that collects data from a user; The typical name, address, etc.
However, the form also requires the user to choose which hotel they want to go to. (they are in drop down menu's). You hit submit then it goes to another page which pulls all the information together and also gives you a price tag.
The costs for all the hotels are in the dbm file. So when you select "whatever hotel" and hit submit, it will go into the dbm file, find "whatever hotel" find its price and then place that in the 2nd page (where you confirm the details).
Okay, that I have got working fine, but the problem lies in the fact that there is a SECOND price that needs to be ADDED to the hotel price.
Lets say for example that the user also selects a tour guide that costs $250. The information is in the database; so how to get the script to add the tour guide price and the hotel price for the confirmation page?
I'm not entirely sure, but I think this portion of the code is the bit I have to change:
if (chk1 <> 0 or chk1 <>"") then
cost_st = chk1 * cost1
else
cost_st = 0
end if
if (chk2 <> 0 or chk2 <>"") then
cost_nd = chk2 * cost2
else
cost_nd = 0
end if
if (rc_reg <> 0 and temp <> 0) then
fee_rate = objrsreg("fee_rate")
cur_type = objrsreg("cur_type")
reg_amount = cost_st + cost_nd
reg_amount = (reg_amount + (no_reg * fee_rate))
At the moment, this piece of code just does the hotel price, (no_reg is actually the number of people going to the hotel, so if the user puts in 2, it will be the cost of the hotel X 2 which is why it says "no_reg * fee_rate".
Comment