I have a script that checks before and after values in a DB then emails the user with the bits that have changed. I created variables from the DB first as strStep1 etc:
then when I send the user an email to tell them of their change
Obviously only one thing may have changed one time, another time three things may have changed. Is there a better way to do this or is my code ok? My code works fine just wondered if I should be doing it another way.
Code:
if request.form("step1") <> strStep1 then
alertStep1 = true
end if
if request.form("step2") <> strStep2 then
alertStep2 = true
end if
if request.form("step3") <> strStep3 then
alertStep3 = true
end if
if request.form("step4") <> strStep4 then
alertStep4 = true
end if
if request.form("step5") <> strStep5 then
alertStep5 = true
end if
if request.form("step6") <> strStep6 then
alertStep6 = true
end if
if request.form("step7") <> strStep7 then
alertStep7 = true
end if
if request.form("step8") <> strStep8 then
alertStep8 = true
end if
if request.form("step9") <> strStep9 then
alertStep9 = true
end if
then when I send the user an email to tell them of their change
Code:
if alertStep1 then
response.write "Step 1 has been updated, you now need to ...."
end if
if alertStep2 then
response.write "Step 2 has been updated, you now need to ...."
end if
etc etc etc
Obviously only one thing may have changed one time, another time three things may have changed. Is there a better way to do this or is my code ok? My code works fine just wondered if I should be doing it another way.