Forum Moderators: open
I am using a ecommerce solution. They gave us some asp variables that are something to the effect
<% DRAWPRODUCTPRICE %>
<% DRAWPRODUCTSALE %>
They way that have it set up for us is we just add these to the body of a page where we want them and the values show up.
Is it possible and how would i be able to subtract these two variables and display the difference on the site? This way i could show the cusomter what they are saving.
Thank you all for your help
Al
For some reason that is not working. Could thoese tags be calling a function and not a var.? Would it be possible to test a var. and show an image if the results were true or false/ Like if the price is over 100 show a free shipping image.
Very well could be two functions. If "DRAWPRODUCTPRICE" and "DRAWPRODUCTSALE" are both variables representing numeric expressions, the example I gave you will surely work. If they are functions, there are instances when they would work and other times when they wouldn't work. It really depends on what those two variables (or functions) are doing.
As far as testing a variable and showing different images based on true/false results, that can be done in a number of ways: (IF THEN ELSE statements, DO WHILE statements, or even a FOR NEXT statement)
Try this on the page:
<%
response.write "Session:" & "<br>"
response.write session("DRAWPRODUCTPRICE") & "<br>"
response.write session("DRAWPRODUCTSALE")
%>
Does anything get written to the page?
If so, they are session variables.
You cannot just use <%=DRAWPRODUCTSALE%> if that variable was not set somewhere on the page.
They could also be set at a previous page, so try:
<%
response.write "Request:" & "<br>"
response.write request("DRAWPRODUCTPRICE") & "<br>"
response.write request("DRAWPRODUCTSALE")
%>
If nothing happens, they are not session variables or variables sent from a previous page.