View Full Version : two pages, one database
Hi, I’ve got two web pages and in both of them I sell the same books. The information from the sale is stored in one Access database. I want to know by looking in the database which sale comes from one page or the other .. how should I do it ? which code should I use? I’m quite new to asp so please, be very clear with your explanations.
Thanks a million in advance !!
BigDaddy
11-07-2002, 07:26 PM
Put a field name in your database named "SOURCE". On each page, you will do an insert, declare a variable named "SOURCE", and give it a value to describe the page.
When you do an insert into the database, I'm assuming you'd insert stuff like book name, price, and the buyer's info--at that time, also just insert "SOURCE".
whammy
11-07-2002, 09:57 PM
You can just get it from the ServerVariables collection:
INSERTQUERY = "INSERT INTO tablename(pagename) VALUES('" & Request.ServerVariables("URL") & "')"
:)
http://www.w3schools.com/asp/coll_servervariables.asp
To loop through all the ServerVariables:
<%
Dim Item
For Each Item in Request.ServerVariables
For iCount = 1 to Request.ServerVariables(Item).Count
Response.Write(Item & " = " & Request.ServerVariables(Item)(iCount) & "<br />" & vbLf)
Next
Next
%>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.