troubleshooting Question

ASP and Cookies not showing information.

Avatar of CLSTEAM
CLSTEAM asked on
ASPWeb Browsers
11 Comments1 Solution390 ViewsLast Modified:
This web page allows customer to search for a property, after the property is found it will display the products offered at this property.  This is the search page.  I will only post the ASP code as the rest is just HTML formatting for the page:

<!-- #include file="./inc/config.asp" -->
<%
      'address = Request.QueryString("address")
      propertyaccount = Request.QueryString("propertyaccount")
      setaddress = Request.QueryString("setaddress")
      str = ""
      nextitem = Request.QueryString("nextitem")
      derror = ""
      dim regExp
      set regExp = new regexp
      regExp.Pattern = "[^0-9a-zA-Z\ ]"
      regExp.Global = True
      address = regExp.Replace(Request.QueryString("address"), "")
      
      if(address <> "" and setaddress = 0) then
            q = "select * from propertylookup where NameOrAddress like '%" & address & "%'"
            if (nextitem > 1) then
                  q = q & " and PropertyAccount not in (select top " & nextitem & " PropertyAccount from propertylookup where NameOrAddress like '%" & address & "%')"
            else
                  nextitem = 1
            end if
            dbRs.Open q, dbConn, 2, 2
            iRecordCount = 0
            do while not dbRs.EOF
                  iRecordCount = iRecordCount + 1
                  dbRs.MoveNext
            loop
            dbRs.Close
            dbRs.Open q, dbConn, 2, 2
            if (not dbRs.BOF and iRecordCount > 1) then
                  dim d
                  if (nextitem < iRecordCount) then
                        dbRs.MoveNext
                  end if
            end if
            if not (dbRs.BOF and dbRs.EOF) then
                  Set dbRs2 = Server.CreateObject ("ADODB.Recordset")
                  q2 = "select * from PropertyAddresses where PropertyAccount = '" & myunescape(dbRs("PropertyAccount")) & "'"
                  dbRs2.Open q2, dbConn, 2,2
                  iRecordCount = 0
                  do while not dbRs2.EOF
                        iRecordCount = iRecordCount + 1
                        dbRs2.MoveNext
                  loop
                  dbRs2.Close
                  if (iRecordCount > 0) then
                        dbRs2.Open q2, dbConn, 2,2
                        str = "<b>" & myunescape(dbRs2("propertyname")) & ":</b><br>" & vbCrLf & _
                              myunescape(dbRs2("propertyaddress")) & "<br>" & vbCrLf & _
                              myunescape(dbRs2("propertycity")) & ", " & myunescape(dbRs2("propertyzip"))
                        nextitem = nextitem + 1
                        view = 1
                        derror = "Is this your location?"
                        propertyaccount = myunescape(dbRs("PropertyAccount"))
                        dbRs2.Close
                        Set dbRs2 = nothing
                  else
                        derror = "Database error: No records found for " & myunescape(dbRs("PropertyAccount"))
                        view = 1
                        nextitem = nextitem + 1
                  end if
            else
                  nextitem = 1
                  view = 0
                  derror = "<b>Sorry, but the property you are looking for is not in our database</b>"
            end if
            dbRs.Close
            Set dbRs = nothing
      end if
      
      if (setaddress = 1 and isnumeric(propertyaccount)) then
            if (request.Cookies.count > 0) then
                  Response.Cookies("property") = ""
                  Response.Cookies("acct") = ""
                  Response.Cookies("Residence") = ""
                  Response.Cookies("pName") = ""
            end if
            q = "select * from PropertyProductLineInfo where propertyaccount = '" & propertyaccount & "' order by ProductLineSequence"
            dbRs.Open q, dbConn, 2,2
            dbRs.MoveFirst
            x = 1
            Set dbRs2 = Server.CreateObject ("ADODB.Recordset")
            q2 = "select * from PropertyAddresses where propertyaccount = '" & myunescape(dbRs("PropertyAccount")) & "'"
            dbRs2.Open q2, dbConn, 2,2
            pname = myunescape(dbRs2("propertyname"))
            paddress = "<b>" & myunescape(dbRs2("propertyname")) & ":</b><br>" & vbCrLf & _
                  myunescape(dbRs2("propertyaddress")) & "<br>" & vbCrLf & _
                  myunescape(dbRs2("propertycity")) & ", " & myunescape(dbRs2("propertyzip"))
            dbRs2.Close
            Set dbRs2 = nothing
            Response.Cookies("acct") = propertyaccount
            Response.Cookies("Residence") = paddress
            Response.Cookies("pName") = pname
            while not dbRs.EOF
                  Response.Cookies("property")("prod" & x) = myunescape(dbRs("product"))
                  x = x + 1
                  dbRs.MoveNext
            wend
            dbRs.Close
            Response.Redirect("sattv-base-pkgs.asp")
      end if

%>

When the property is found, it wll redirect the browser to the sattv-base-pkgs.asp page which will display the products offered at this property.  This is the code for sattv-base-pkgs.asp:

<!-- #include file="./inc/config.asp" -->
<%
      dim x, y
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
      <title>Consolidated Smart Systems</title>
      <LINK REL="stylesheet" HREF="style.css" TYPE="text/css">
<SCRIPT LANGUAGE="JavaScript" SRC="nav.js"></SCRIPT>
<script language="JavaScript">
strSection="products_services";
strSub="sat_tv";
strSubSub="sattv_base_pkgs";
checkResidence();
</script>
</head>

<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#DAEEF7">
<!--LOGO AND NAV TABLE-->
<table width="760" cellpadding="0" cellspacing="0" border="0">
      <tr>
            <td>
                  <table width="760" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                              <td width="299" valign="top" align="left" rowspan="4"><a href="index.html"><img src="images/logo.gif" width="299" height="130" alt="Consolidated Smart Systems" border="0"></a></td>
                              <td width="461" valign="top" align="left"><img src="images/lines-top.gif" width="281" height="47" alt="" border="0"><!--ABOUT AND CONTACT NAV (IN NAV.JS FILE)--><script language="JavaScript">printAboutContactNav();</script></td>
                        </tr>
                        <tr>
                              <td width="461" valign="top" align="left"><!--PRODUCTS/CUSTOMER CARE NAV (IN NAV.JS FILE)--><script language="JavaScript">printPSCCNav();</script></td>
                        </tr>
                        <tr>
                              <td width="461" valign="top" align="left"><img src="images/lines-middle.gif" width="461" height="22" alt="" border="0"></td>
                        </tr>
                        <tr>
                              <td width="461" valign="top" align="left"><img src="images/lines-bottom.gif" width="461" height="28" alt="" border="0"></td>
                        </tr>
                  </table>
            </td>
      </tr>
</table>
<!--MAIN CONTENT AND RIGHT NAV BOX TABLE-->
<table width="760" cellpadding="0" cellspacing="0" border="0">
      <tr>
            <td valign="top" align="left" width="21" rowspan="2"><img src="images/spacer.gif" width="21" height="1" alt="" border="0"></td>
            <td valign="top" align="left" width="440"><img src="images/header-available-packages.gif" width="440" height="37" alt="FAQS" border="0"></td>
            <td valign="top" align="left" width="24" rowspan="2"><img src="images/spacer.gif" width="24" height="1" alt="" border="0"></td>
            <td valign="top" align="left" width="272" rowspan="2"><!--NAV BOX TABLE--><table width="270" cellpadding="0" cellspacing="0" border="0" style="border: solid #A9CEEE 1px; background-color: #C7DCEB;">
                        <tr>
                              <td valign="top" align="left" width="10" rowspan="2"><img src="images/spacer.gif" width="10" height="1" alt="" border="0"></td>
                              <td valign="top" align="left" width="260" colspan="2"><img src="images/nav-box-sattv-internet.gif" width="260" height="37" alt="" border="0"></td>
                        </tr>
                        <tr>
                              <td valign="top" align="left" width="130" class="nav" ><!--RIGHT NAV BOX LINKS (IN NAV.JS FILE)--><script language="JavaScript">printNavBox();</script></td>
                              <td valign="top" align="left" width="130" class="red-bold"><!--RIGHT NAV BOX SUB LINKS (IN NAV.JS FILE)--><script language="JavaScript">printSubNavBox();</script></td>
                        </tr>
                        <tr>
                              <td valign="top" align="left" colspan="3"><img src="images/spacer.gif" width="1" height="10" alt="" border="0"></td>
                        </tr>
                  </table><!--END NAV BOX-->
                  <br>
                  <!--CURRENT RESIDENCE BOX--><script>printCurrentResidence();</script><!--END CURRENT RESIDENCE BOX-->
                  <br>
                  <!--ENJOY PAY PER VIEW BOX TABLE--><table width="270" cellpadding="0" cellspacing="0" border="0" style="border: solid #A9CEEE 1px; background-color: #EAF6FB;">
                        <tr>
                              <td valign="top" align="left" width="10" rowspan="2"><img src="images/spacer.gif" width="10" height="1" alt="" border="0"></td>
                              <td valign="top" align="left" colspan="2"><img src="images/enjoy-pay-per-view.gif" width="260" height="57" alt="" border="0"></td>
                        </tr>
                        <tr>
                              <td valign="top" align="left"><img src="images/spacer.gif" width="4" height="1" alt="" border="0"></td>
                              <td valign="top" align="left"><img src="images/pic-pay-per-view.jpg" width="243" height="90" alt="" border="0"><p>Many of the country's biggest sporting events and first-run movies are offered via satellite TV. Subscribe to a package or pick and choose the ones you want. It's as easy as 1-2-3!</p></td>
                        </tr>
                        <tr>
                              <td valign="top" align="left" colspan="3"><img src="images/spacer.gif" width="1" height="10" alt="" border="0"></td>
                        </tr>
                  </table><!--END PAY PER VIEW BOX-->
            </td>
            <td valign="top" align="left" width="3" rowspan="2"><img src="images/spacer.gif" width="3" height="1" alt="" border="0"></td>
      </tr>
      <tr>
            <td valign="top" align="left"><span class="red-header">Satellite TV Base Packages:</span>
            <p>These low-cost packages offer great channel line-ups and entertainment for the whole family.</p>
<%
            p = 0
            cat = "base"
            displayall = 1
            for each x in Request.Cookies
            if Request.Cookies(x).HasKeys then
                  for each y in Request.Cookies(x)
                        if y <> "acct" then
                              q = "select * from products where product = '" & Request.Cookies(x)(y) & "'"
                              displayall = 0
                              dbRs.Open q, dbConn, 2, 2
                              if (myunescape(dbRs("category")) = cat) then
                                    p = p + 1
                                    header = myunescape(dbRs("productheader"))
                                    desc = myunescape(dbRs("productparagraph"))
                                    listing = myunescape(dbRs("productlink"))
                                    listing2 = myunescape(dbRs("productlinkname"))
                                    if (dbRs("producthasalink") = true) then
                                          desc = desc & "<br><span class=""red-bold"">&gt;</span><a href=""" & listing & """ class=""red-bold"">" & listing2 & "</a>"
                                    end if
%>
<hr>
<p><b><%=header%></b><br>
<%=desc%>
</p>
<%
                              end if
                              dbRs.Close
                        end if
                  next
            end if
      next
      if (p < 1 and displayall = 0) then
            response.Write("<br><p><b>Sorry, this service is not available at your property.</b></p>")
      end if
      
      if (displayall = 1) then
            q = "select * from products"
            dbRs.Open q, dbConn, 2, 2
            dbRs.MoveFirst
            while not dbRs.EOF
                  if (myunescape(dbRs("category")) = cat) then
                        header = myunescape(dbRs("productheader"))
                        desc = myunescape(dbRs("productparagraph"))
                        listing = myunescape(dbRs("productlink"))
                        listing2 = myunescape(dbRs("productlinkname"))
                        if (dbRs("producthasalink") = true) then
                              desc = desc & "<br><span class=""red-bold"">&gt;</span><a href=""" & listing & """ class=""red-bold"">" & listing2 & "</a>"
                        end if
%>
<hr>
<p><b><%=header%></b><br>
<%=desc%>
</p>
<%
                  end if
                  dbRs.MoveNext
            wend
            dbRs.Close
      end if
%>
</td>
      </tr>
</table>
<br><br>
<!--FOOTER-->
<table width="760" cellpadding="0" cellspacing="0" border="0">
      <tr>
            <td valign="top" align="left" width="21"><img src="images/spacer.gif" width="21" height="1" alt="" border="0"></td>
            <td valign="top" align="left"><script language="JavaScript">printFooter();</script></td>
      </tr>
</table>
<br>
<br>

</body>
</html>

The problem is that no information is currently being displayed after the customer selects a property.  I had this problem before and I found that it was "resolved" by deleting the cookies.  Now that does not work anymore.  IE6, IE7, Firefox and Netscape will not display anything.  Even after I delete the cookies.  Opera however is displaying the information.  Any ideas?  Thanks for any feedback.
ASKER CERTIFIED SOLUTION
L00M

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros