Hi, Trying to solve a problem with no knowledge of asp.
I have a dropdown list populated from my database with card decription. The output is names like, abstract,illust ration etc.
I am sending the results to another page like so - .. html
-
directory.asp?PostCardID=XX
-
..
Now the request.queryst ring I presume should be something like this. - ..asp
-
<%=request.QueryString("PostcardID")%>
-
..
But all I get is xx as output.
When someone selects from the dropdown I am trying to populate the page with all those from the database who have the same title and so am trying to get the ids.
Is there something more to this, I am sure there is.
Thanks in advance for any help.
Basically I was told I had to get the get the PostCardID into the action querystring
Richard
32 3884 ck9663 2,878
Recognized Expert Specialist
Hi, Trying to solve a problem with no knowledge of asp.
I have a dropdown list populated from my database with card decription. The output is names like, abstract,illust ration etc.
I am sending the results to another page like so - .. html
-
directory.asp?PostCardID=XX
-
..
Now the request.queryst ring I presume should be something like this. - ..asp
-
<%=request.QueryString("PostcardID")%>
-
..
But all I get is xx as output.
When someone selects from the dropdown I am trying to populate the page with all those from the database who have the same title and so am trying to get the ids.
Is there something more to this, I am sure there is.
Thanks in advance for any help.
Basically I was told I had to get the get the PostCardID into the action querystring
Richard
try the redirect method.
<%
response.redire ct "yourtarget.asp ?variable=" & StrValueOfYourV ariable
%>
or something like that
Hi,
If you are getting any problem accessing querystring , you can even use Hidden varaibles.
e.g.
<Input type ="hidden" name ="PostCardID " value ="value">
and access this value in target.asp as Request.Form("P ostCard")
Thanks for the reply guys,
Neither idea could I get to work.
Will bash on.
Thanks
jhardman 3,406
Recognized Expert Specialist
Thanks for the reply guys,
Neither idea could I get to work.
Will bash on.
Thanks
Wait, are you saying that you are getting the postcardID out of the querystring, but you actually want more data from the database? If that is the case, then on the second page you need to open the db again and look up that info. - objRS.open "SELECT * FROM cardTable WHERE postcardID = " & request("postcardID"), objConn
The only information you passed from one page to the other is the postcardID.
Jared
Thanks for the reply guys,
Neither idea could I get to work.
Will bash on.
Thanks
From what I can tell, your problem is related to getting the value to the querystring itself.
Here is the way I normally do it if I only have 1 dropdown, usually for navigation.
[HTML] <select name="navigate" onChange="windo w.location='dir ectory.asp?Post CardID=' + this.options[this.selectedIn dex].value">[/HTML]
You could also do this through a javascript function. Or you could put the dropdown in a form and when they push the submit button, it would submit the value.
[HTML]<form method="get" action="directo ry.asp">
<select name="PostCardI D">
<input type="submit" />
</form>[/HTML]
Then on the directory.asp you would do like Jared recommended.
Hey Guys, Thanks, I really think I am getting somewhere with your help.
Adding your suggestion to the form I now get the name selected from the dropdown list showing on the next page, ie select abstract art, and abstract art shows up on the target page. Great! - ..asp
-
-
<form method="Post">
-
<select name="navigate" onChange="window.location='manner.asp?PostCardID=' + this.options[this.selectedIndex].value">
-
-
<%
-
Set oRs=Server.CreateObject("adodb.recordset")
-
strSQL = "SELECT DISTINCT CardDescription FROM tblGreetingPostCards ORDER BY CardDescription"
-
oRs.Open strSQL, conn
-
-
Do while not oRs.EOF
-
if Request.Form("GreetingPostCards") = oRs("CardDescription") then 'if this is the selected one then display as selected
-
Response.Write "<OPTION VALUE = '" & oRS ("CardDescription") & "' SELECTED>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
else
-
Response.Write "<OPTION VALUE = '" & oRs ("CardDescription") & "'>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
end if
-
loop
-
%>
-
</SELECT>
-
</form>
-
..asp
And you are spot on, wasnt really explaining well, but I think i probably do need more info from the database. Not sure what is going on exactly, but where exactly would I add the below code.
Basically I need to populate the page with all those in the database with the headings selected. So I imagine I need to get the ids. - ..asp
-
-
objRS.open "SELECT * FROM GreetingPostCards WHERE postcardID = " & request("postcardID"), objConn
-
-
..asp
Tha actual page has all this asp at the top. Do I add it there? and do I have to wrap it in anything? or do I add it to the body of the page. - ..asp
-
-
-
-
-
-
<!--#Include File="art/dbconnect.asp"-->
-
<%
-
-
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
' Product: Greeting Card Pro Version 2.1
-
' Author: AdComplete.com, LLC
-
' Date: January 21, 2002
-
' (c) Copyright 2000-2002 by AdComplete.com, LLC. All rights reserved.
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-
-
lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author,ThumbnailURL,AdvancedCard,ThumbnailHTML,Rnd([PostCardID]) From tblGreetingPostCards Where CategoryID=" & Clng(lngCategoryID) & " Order By Rnd([PostCardID])"
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
Response.Write "<p>No cards found in database for this category."
-
Response.End
-
End If
-
End If
-
-
'search feature
-
If Request("SearchWord") <> "" Then
-
strWd=Replace(Request("SearchWord"),"'","''")
-
strSQL="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author, "
-
strSQL=strSQL & " ThumbnailURL,AdvancedCard,ThumbnailHTML From tblGreetingPostCards Where Keywords Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultHeadline Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " CardDescription Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " Author Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultMessage Like '%" & strWD & "%' "
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
rsCard.Open strSQL, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
End If
-
-
strAddition="bgcolor=" & Chr(34) & Application("gcp_SearchPageBackgroundColor") & Chr(34)
-
strCategoryBarFontColor=Application("gcp_SearchPageFontBarColor")
-
strCategoryBarColor=Application("gcp_SearchPageBarColor")
-
-
'Retrieve Category Name
-
If lngCategoryID <> "" and lngCategoryID <> 0 Then
-
Set rsCat=connPostCardSoft.Execute("Select * From tblGreetingCategories Where CategoryID=" & Clng(lngCategoryID))
-
strCat="" & rsCat("CategoryName")
-
-
If rsCat("CategoryBackgroundImage")<> "" Then
-
strAddition="background=" & Chr(34) & rsCat("CategoryBackgroundImage") & Chr(34)
-
End If
-
If rsCat("CategoryBackgroundColor")<>"" Then
-
strAddition="bgcolor=" & Chr(34) & rsCat("CategoryBackgroundColor") & Chr(34)
-
End If
-
strCategoryBarFontColor=rsCat("CategoryBarFontColor")
-
strCategoryBarColor=rsCat("CategoryBarColor")
-
FontName=rsCat("FontName")
-
FontColor=rsCat("FontColor")
-
Else
-
strCat="Search results for:" & strWD
-
FontName=Application("gcp_FontName")
-
FontColor=Application("gcp_FontColor")
-
End If
-
-
-
Select Case Request("Action")
-
case " << "
-
intpage = 1
-
case " < "
-
intpage = Request("intpage")-1
-
if intpage < 1 then intpage = 1
-
case " > "
-
intpage = Request("intpage")+1
-
if intpage > intPageCount then intpage = IntPageCount
-
Case " >> "
-
intpage = intPageCount
-
case else
-
intpage = 1
-
If Request.QueryString("intpage") <> "" Then
-
intpage=Request.QueryString("intpage")
-
End If
-
end select
-
-
-
-
%>
-
-
-
-
..asp
Thanks a million
Richard
Richard,
I am a bit confused now. I understand what the current code is doing, but I am trying to figure out what you have and what you are actually trying to accomplish.
The snippet that you referred to that was provided by Jared is only that, a snippet. You would need to write more code to do anything with it. Please be more specific about what you expect to happen that isn't happening now.
Hi, The page as it stands is below. There is a loop in the table that populates the page with my card links together with popups. I am trying to add a dropdown list to the page with the cardDescription got from the database. What I want is to populate the page with all cards that correspond to each carddescription , so if 50 cards are categorized under abstract, that only those populate the page.
Basically trying to get the postcard id into a querystring and to get that to populate the page in the loop.
I have the dropdown on another page, although I want it on this page I was not able to get it working with the database connection.
So all the cards are in Categories...li ke categoryid=1,2, 3,4,5 etc
then each has a card description cardDescription like "abstract","ill ustration" etc.
So it is to get the card associated with each card description to populate the page and I think that has to be done with the card ID. - .. ASP
-
-
-
<!--#Include File="art/dbconnect.asp"-->
-
<%
-
-
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
' Product: Greeting Card Pro Version 2.1
-
' Author: AdComplete.com, LLC
-
' Date: January 21, 2002
-
' (c) Copyright 2000-2002 by AdComplete.com, LLC. All rights reserved.
-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-
-
lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author,ThumbnailURL,AdvancedCard,ThumbnailHTML,Rnd([PostCardID]) From tblGreetingPostCards Where CategoryID=" & Clng(lngCategoryID) & " Order By Rnd([PostCardID])"
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
Response.Write "<p>No cards found in database for this category."
-
Response.End
-
End If
-
End If
-
-
'search feature
-
If Request("SearchWord") <> "" Then
-
strWd=Replace(Request("SearchWord"),"'","''")
-
strSQL="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author, "
-
strSQL=strSQL & " ThumbnailURL,AdvancedCard,ThumbnailHTML From tblGreetingPostCards Where Keywords Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultHeadline Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " CardDescription Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " Author Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultMessage Like '%" & strWD & "%' "
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
rsCard.Open strSQL, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
End If
-
-
strAddition="bgcolor=" & Chr(34) & Application("gcp_SearchPageBackgroundColor") & Chr(34)
-
strCategoryBarFontColor=Application("gcp_SearchPageFontBarColor")
-
strCategoryBarColor=Application("gcp_SearchPageBarColor")
-
-
'Retrieve Category Name
-
If lngCategoryID <> "" and lngCategoryID <> 0 Then
-
Set rsCat=connPostCardSoft.Execute("Select * From tblGreetingCategories Where CategoryID=" & Clng(lngCategoryID))
-
strCat="" & rsCat("CategoryName")
-
-
If rsCat("CategoryBackgroundImage")<> "" Then
-
strAddition="background=" & Chr(34) & rsCat("CategoryBackgroundImage") & Chr(34)
-
End If
-
If rsCat("CategoryBackgroundColor")<>"" Then
-
strAddition="bgcolor=" & Chr(34) & rsCat("CategoryBackgroundColor") & Chr(34)
-
End If
-
strCategoryBarFontColor=rsCat("CategoryBarFontColor")
-
strCategoryBarColor=rsCat("CategoryBarColor")
-
FontName=rsCat("FontName")
-
FontColor=rsCat("FontColor")
-
Else
-
strCat="Search results for:" & strWD
-
FontName=Application("gcp_FontName")
-
FontColor=Application("gcp_FontColor")
-
End If
-
-
-
Select Case Request("Action")
-
case " << "
-
intpage = 1
-
case " < "
-
intpage = Request("intpage")-1
-
if intpage < 1 then intpage = 1
-
case " > "
-
intpage = Request("intpage")+1
-
if intpage > intPageCount then intpage = IntPageCount
-
Case " >> "
-
intpage = intPageCount
-
case else
-
intpage = 1
-
If Request.QueryString("intpage") <> "" Then
-
intpage=Request.QueryString("intpage")
-
End If
-
end select
-
-
-
-
%>
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
<html>
-
-
-
<head>
-
<title><%=strCat%></title>
-
<meta name="description" content="art directory,painting,abstract,ceramics and ecards of quality contemporary artists.">
-
<meta http-equiv="cache-control" content="no-cache">
-
<meta http-equiv="pragma" content="no-cache">
-
<link rel="stylesheet" type="text/css" href="css/newwotartist.css">
-
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
-
<meta name="ProgId" content="FrontPage.Editor.Document">
-
<script src="/js/dw_event.js" type="text/javascript"></script>
-
<script src="/js/dw_tooltip.js" type="text/javascript"></script>
-
<script src="/js/dw_viewport.js" type="text/javascript"></script>
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
<style type="text/css">
-
form.test {background: transparent;border-color: #000;padding-left:0px;padding-top:20px;font-size: 10px;}
-
select {width:100%;background-color:#303030;font-size: 10px;color:silver;}
-
option{background-color:#303030; font-size: 10px; color:silver;}
-
-
.texta {
-
font-size: 14px;
-
background-color: #c0c0c0;
-
border: 1px solid #808080;
-
-
width: 110px;
-
height: 18px;
-
}
-
#fixedtipdiv
-
{
-
position:absolute;
-
padding: 2px;
-
border:1px solid black;
-
font:normal 12px Verdana;
-
line-height:18px;
-
z-index:100;
-
}
-
div#tipDiv {
-
position:absolute; visibility:hidden; left:0; top:0; z-index:10000;
-
background-color:#efefef; border:1px solid #000;
-
width:180px; padding:6px;
-
color:#000; font-size:11px; line-height:1.3;
-
}
-
/* These are used in the wrapTipContent function */
-
div#tipDiv div.img { text-align:center }
-
div#tipDiv div.txt { text-align:center; margin-top:4px }
-
.silver{color:silver}
-
</style>
-
-
</head>
-
-
<body <%=strAddition%> text="<%=FontColor%>" link="<%=FontColor%>" vlink="<%=FontColor%>" alink="<%=FontColor%>">
-
<%=Application("gcp_HeaderHTML")%>
-
<div id="container">
-
<div id="outer">
-
<div id="topgap"></div>
-
<div id="contentt">
-
<div id="leftlogo"><div id="relative">
-
<img class="logo" border="0" src="/images2/wotartist1.jpg" alt="wotecard" title="wotecard" width="378" height="57">
-
</div></div>
-
<div id="greybox">
-
<ul id="navlist">
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=1" title="AMERICAS">AMERICAS</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=2" title="UK">UK</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=4" title="EUROPE">EUROPE</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=3" title="AUSTRALIA">AUSTRALIA</a></span></li>
-
<li><span class="large"><a class="men"href="/directory.asp?categoryid=5" title="Asia & middle east">ASIA/MIDDLE EAST</a></span></li>
-
<li><span class="large"><a class="mena" href="/submit.asp" title="SUBMIT">submit</a></span></li>
-
<li><span class="large"><a class="mena" href="/submit.asp#a1" title="DONATE">donate</a></span></li>
-
<li><span class="large"><a class="mena" href="/websitedesign.asp" title="DESIGN"home>design</a></span></li>
-
<li><span class="large"><a class="mena" href="./" title="home">home</a></span></li>
-
</ul>
-
-
<tr>
-
<td width="545">
-
<div style="height:25px;"></div>
-
<form method="POST" action="directory.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" language="JavaScript">
-
<p align="left"><font face="Arial" size="2"></font>
-
<!--webbot bot="Validation" s-display-name="Search Word" b-value-required="TRUE" i-minimum-length="1" --><input type="text" class="texta" name="SearchWord" size="13">
-
<input type="image" SRC="art/images/button.gif" style="vertical-align:top;"value="Search" name="B1" width="60" height="22"></p>
-
</form>
-
</td>
-
</tr>
-
</div>
-
<div style="clear:both;"></div>
-
-
<div id="websites">
-
<p></p>
-
-
<%=request.QueryString("PostcardID")%>
-
-
-
<table width="100%">
-
-
-
-
<%
-
If Not rsCard.EOF Then
-
rsCard.AbsolutePage = intPage
-
-
-
For intRecord = 1 To rsCard.PageSize
-
CurrentColumn=1
-
%>
-
<tr>
-
-
<%
-
Do While CurrentColumn<=5
-
%>
-
<td><br><font size="2"><p></p>
-
<a onmouseover="doTooltip(event,'<img src="<%=Server.URLPathEncode(rsCard("ThumbnailURL"))%>" alt="" border="0"><div class="tp2"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></div>' )" onmouseout="hideTip()" href="http://<%=rsCard("DefaultHeadline")%>" target="_blank"><%=rsCard("CardDescription")%></a>
-
</font>
-
-
<p align="left"><font size="1"><span style="color : #303030;"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></font></span>
-
<p align="left"><font face="<%=FontName%>" size="1"><a href="card.asp?PostCardID=<%=rsCard("PostCardID")%>">
-
<I><%=rsCard("DefaultMessage")%></I><a>
-
-
-
</td>
-
<%
-
-
CurrentColumn=CurrentColumn+1
-
rsCard.MoveNext
-
If rsCard.EOF Then Exit For
-
Loop
-
%>
-
</tr>
-
-
<%
-
-
-
intRecord =intRecord +1
-
-
Next
-
End If
-
%>
-
-
</tr>
-
<tr>
-
<td colspan="5"><%If intpagecount > 1 Then %>
-
<font face="<%=FontName%>" size="1"><form name="MovePage" action="directory.asp?CategoryID=<%=lngCategoryID%>" method="post">
-
<input type="hidden" name="intpage" value="<%=intpage%>"><input type="hidden" name="SearchWord" value="<%=strWd%>"><div align="center"><center><p><br><input
-
type="submit" name="action" value=" << "> <input type="submit" name="action"
-
value=" < "> <input type="submit" name="action" value=" > "> <input type="submit"
-
name="action" value=" >> "><br>
-
Page: <%=Intpage & " of " & intpagecount%> <br>
-
</font></p>
-
-
</form>
-
<% End If %></td>
-
</tr>
-
<tr>
-
<td colspan="5"><br><br><br><br><p><font face="Arial" align="left" size="2"><br><font face="Arial" size="1">
-
<b>Important Copyright Notice!</b> The copyright of all images on this site is property of the respective artists. Any use or reproduction of the
-
content without prior written permission of the artist is strictly forbidden.
-
</font></p></td></tr>
-
-
</table>
-
<%=Application("gcp_FooterHTML")%>
-
-
-
-
</div>
-
<div style="clear:both;"> </div>
-
-
</div>
-
<div id="footer" ></div>
-
</div></div>
-
</body>
-
</html>
-
<% connPostCardSoft.Close()
-
Set connPostCardSoft=Nothing
-
Set rsCard=Nothing
-
Set rsCat=Nothing
-
%>
-
-
..ASP
the dropdown I got working on another page is - ..asp
-
-
-
-
<%@ Language=VBScript %>
-
<%Option explicit
-
Dim oRs, conn, connect, strSQL
-
-
set conn=server.CreateObject ("adodb.connection")
-
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/fpdb/greetingcardpro.mdb") & ";Persist Security Info=False"
-
conn.Open connect
-
-
%>
-
-
<html><head><title></title>
-
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
</head>
-
<body>
-
<div id="menu">
-
<form method="Post">
-
<select name="navigate" onChange="window.location='manner.asp?PostCardID=' + this.options[this.selectedIndex].value">
-
-
<%
-
Set oRs=Server.CreateObject("adodb.recordset")
-
strSQL = "SELECT DISTINCT CardDescription FROM tblGreetingPostCards ORDER BY CardDescription"
-
oRs.Open strSQL, conn
-
-
Do while not oRs.EOF
-
if Request.Form("GreetingPostCards") = oRs("CardDescription") then 'if this is the selected one then display as selected
-
Response.Write "<OPTION VALUE = '" & oRS ("CardDescription") & "' SELECTED>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
else
-
Response.Write "<OPTION VALUE = '" & oRs ("CardDescription") & "'>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
end if
-
loop
-
%>
-
</SELECT>
-
</form>
-
</div>
-
</body>
-
</html>
-
-
-
..asp
I dont know if that makes sence.
Thanks again
Richard
Hi, The page as it stands is below. There is a loop in the table that populates the page with my card links together with popups. I am trying to add a dropdown list to the page with the cardDescription got from the database. What I want is to populate the page with all cards that correspond to each carddescription , so if 50 cards are categorized under abstract, that only those populate the page.
Basically trying to get the postcard id into a querystring and to get that to populate the page in the loop.
I have the dropdown on another page, although I want it on this page I was not able to get it working with the database connection.
So all the cards are in Categories...li ke categoryid=1,2, 3,4,5 etc
then each has a card description cardDescription like "abstract","ill ustration" etc.
So it is to get the card associated with each card description to populate the page and I think that has to be done by associating each postcard ID with names in the carddescription . Maybe one should send the carddescription instead of id and in the query string, write if cardescription then cardID - .. ASP
-
-
-
<!--#Include File="art/dbconnect.asp"-->
-
<%
-
-
-
-
lngCategoryID=CLng(Request("CategoryID"))
-
If lngCategoryID <> "" And lngCategoryID <> 0 Then
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
SQLQuery="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author,ThumbnailURL,AdvancedCard,ThumbnailHTML,Rnd([PostCardID]) From tblGreetingPostCards Where CategoryID=" & Clng(lngCategoryID) & " Order By Rnd([PostCardID])"
-
rsCard.Open SQLQuery, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
-
If rsCard.EOF=True Then
-
Response.Write "<p>No cards found in database for this category."
-
Response.End
-
End If
-
End If
-
-
'search feature
-
If Request("SearchWord") <> "" Then
-
strWd=Replace(Request("SearchWord"),"'","''")
-
strSQL="Select PostCardID,DefaultHeadline,CardDescription,DefaultMessage,Author, "
-
strSQL=strSQL & " ThumbnailURL,AdvancedCard,ThumbnailHTML From tblGreetingPostCards Where Keywords Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultHeadline Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " CardDescription Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " Author Like '%" & strWD & "%' OR "
-
strSQL=strSQL & " DefaultMessage Like '%" & strWD & "%' "
-
-
Set connPostCardSoft=Server.CreateObject("ADODB.Connection")
-
connPostCardSoft.Open PostCardSoftConnectString
-
Set rsCard=Server.CreateObject("ADODB.Recordset")
-
rsCard.CursorLocation = 3
-
rsCard.Open strSQL, connPostCardSoft
-
rsCard.PageSize = 200
-
intPageCount = rsCard.PageCount
-
End If
-
-
strAddition="bgcolor=" & Chr(34) & Application("gcp_SearchPageBackgroundColor") & Chr(34)
-
strCategoryBarFontColor=Application("gcp_SearchPageFontBarColor")
-
strCategoryBarColor=Application("gcp_SearchPageBarColor")
-
-
'Retrieve Category Name
-
If lngCategoryID <> "" and lngCategoryID <> 0 Then
-
Set rsCat=connPostCardSoft.Execute("Select * From tblGreetingCategories Where CategoryID=" & Clng(lngCategoryID))
-
strCat="" & rsCat("CategoryName")
-
-
If rsCat("CategoryBackgroundImage")<> "" Then
-
strAddition="background=" & Chr(34) & rsCat("CategoryBackgroundImage") & Chr(34)
-
End If
-
If rsCat("CategoryBackgroundColor")<>"" Then
-
strAddition="bgcolor=" & Chr(34) & rsCat("CategoryBackgroundColor") & Chr(34)
-
End If
-
strCategoryBarFontColor=rsCat("CategoryBarFontColor")
-
strCategoryBarColor=rsCat("CategoryBarColor")
-
FontName=rsCat("FontName")
-
FontColor=rsCat("FontColor")
-
Else
-
strCat="Search results for:" & strWD
-
FontName=Application("gcp_FontName")
-
FontColor=Application("gcp_FontColor")
-
End If
-
-
-
Select Case Request("Action")
-
case " << "
-
intpage = 1
-
case " < "
-
intpage = Request("intpage")-1
-
if intpage < 1 then intpage = 1
-
case " > "
-
intpage = Request("intpage")+1
-
if intpage > intPageCount then intpage = IntPageCount
-
Case " >> "
-
intpage = intPageCount
-
case else
-
intpage = 1
-
If Request.QueryString("intpage") <> "" Then
-
intpage=Request.QueryString("intpage")
-
End If
-
end select
-
-
-
-
%>
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
<html>
-
-
-
<head>
-
<title><%=strCat%></title>
-
<meta name="description" content="art directory,painting,abstract,ceramics and ecards of quality contemporary artists.">
-
<meta http-equiv="cache-control" content="no-cache">
-
<meta http-equiv="pragma" content="no-cache">
-
<link rel="stylesheet" type="text/css" href="css/newwotartist.css">
-
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
-
<meta name="ProgId" content="FrontPage.Editor.Document">
-
<script src="/js/dw_event.js" type="text/javascript"></script>
-
<script src="/js/dw_tooltip.js" type="text/javascript"></script>
-
<script src="/js/dw_viewport.js" type="text/javascript"></script>
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
<style type="text/css">
-
form.test {background: transparent;border-color: #000;padding-left:0px;padding-top:20px;font-size: 10px;}
-
select {width:100%;background-color:#303030;font-size: 10px;color:silver;}
-
option{background-color:#303030; font-size: 10px; color:silver;}
-
-
.texta {
-
font-size: 14px;
-
background-color: #c0c0c0;
-
border: 1px solid #808080;
-
-
width: 110px;
-
height: 18px;
-
}
-
#fixedtipdiv
-
{
-
position:absolute;
-
padding: 2px;
-
border:1px solid black;
-
font:normal 12px Verdana;
-
line-height:18px;
-
z-index:100;
-
}
-
div#tipDiv {
-
position:absolute; visibility:hidden; left:0; top:0; z-index:10000;
-
background-color:#efefef; border:1px solid #000;
-
width:180px; padding:6px;
-
color:#000; font-size:11px; line-height:1.3;
-
}
-
/* These are used in the wrapTipContent function */
-
div#tipDiv div.img { text-align:center }
-
div#tipDiv div.txt { text-align:center; margin-top:4px }
-
.silver{color:silver}
-
</style>
-
-
</head>
-
-
<body <%=strAddition%> text="<%=FontColor%>" link="<%=FontColor%>" vlink="<%=FontColor%>" alink="<%=FontColor%>">
-
<%=Application("gcp_HeaderHTML")%>
-
<div id="container">
-
<div id="outer">
-
<div id="topgap"></div>
-
<div id="contentt">
-
<div id="leftlogo"><div id="relative">
-
<img class="logo" border="0" src="/images2/.jpg" alt="" title="" width="378" height="57">
-
</div></div>
-
<div id="greybox">
-
<ul id="navlist">
-
-
</ul>
-
-
<tr>
-
<td width="545">
-
<div style="height:25px;"></div>
-
<form method="POST" action="directory.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" language="JavaScript">
-
<p align="left"><font face="Arial" size="2"></font>
-
<!--webbot bot="Validation" s-display-name="Search Word" b-value-required="TRUE" i-minimum-length="1" --><input type="text" class="texta" name="SearchWord" size="13">
-
<input type="image" SRC="art/images/button.gif" style="vertical-align:top;"value="Search" name="B1" width="60" height="22"></p>
-
</form>
-
</td>
-
</tr>
-
</div>
-
<div style="clear:both;"></div>
-
-
<div id="websites">
-
<p></p>
-
-
<%=request.QueryString("PostcardID")%>
-
-
-
<table width="100%">
-
-
-
-
<%
-
If Not rsCard.EOF Then
-
rsCard.AbsolutePage = intPage
-
-
-
For intRecord = 1 To rsCard.PageSize
-
CurrentColumn=1
-
%>
-
<tr>
-
-
<%
-
Do While CurrentColumn<=5
-
%>
-
<td><br><font size="2"><p></p>
-
<a onmouseover="doTooltip(event,'<img src="<%=Server.URLPathEncode(rsCard("ThumbnailURL"))%>" alt="" border="0"><div class="tp2"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></div>' )" onmouseout="hideTip()" href="http://<%=rsCard("DefaultHeadline")%>" target="_blank"><%=rsCard("CardDescription")%></a>
-
</font>
-
-
<p align="left"><font size="1"><span style="color : #303030;"><%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%></font></span>
-
<p align="left"><font face="<%=FontName%>" size="1"><a href="card.asp?PostCardID=<%=rsCard("PostCardID")%>">
-
<I><%=rsCard("DefaultMessage")%></I><a>
-
-
-
</td>
-
<%
-
-
CurrentColumn=CurrentColumn+1
-
rsCard.MoveNext
-
If rsCard.EOF Then Exit For
-
Loop
-
%>
-
</tr>
-
-
<%
-
-
-
intRecord =intRecord +1
-
-
Next
-
End If
-
%>
-
-
</tr>
-
<tr>
-
<td colspan="5"><%If intpagecount > 1 Then %>
-
<font face="<%=FontName%>" size="1"><form name="MovePage" action="directory.asp?CategoryID=<%=lngCategoryID%>" method="post">
-
<input type="hidden" name="intpage" value="<%=intpage%>"><input type="hidden" name="SearchWord" value="<%=strWd%>"><div align="center"><center><p><br><input
-
type="submit" name="action" value=" << "> <input type="submit" name="action"
-
value=" < "> <input type="submit" name="action" value=" > "> <input type="submit"
-
name="action" value=" >> "><br>
-
Page: <%=Intpage & " of " & intpagecount%> <br>
-
</font></p>
-
-
</form>
-
<% End If %></td>
-
</tr>
-
<tr>
-
<td colspan="5"><br><br><br><br><p><font face="Arial" align="left" size="2"><br><font face="Arial" size="1">
-
<b>.
-
</font></p></td></tr>
-
-
</table>
-
<%=Application("gcp_FooterHTML")%>
-
-
-
-
</div>
-
<div style="clear:both;"> </div>
-
-
</div>
-
<div id="footer" ></div>
-
</div></div>
-
</body>
-
</html>
-
<% connPostCardSoft.Close()
-
Set connPostCardSoft=Nothing
-
Set rsCard=Nothing
-
Set rsCat=Nothing
-
%>
-
-
..ASP
the dropdown I got working on another page is - ..asp
-
-
-
-
<%@ Language=VBScript %>
-
<%Option explicit
-
Dim oRs, conn, connect, strSQL
-
-
set conn=server.CreateObject ("adodb.connection")
-
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/fpdb/greetingcardpro.mdb") & ";Persist Security Info=False"
-
conn.Open connect
-
-
%>
-
-
<html><head><title></title>
-
-
<script language="javascript">
-
<!--
-
-
function dept_onchange(frmSelect) {
-
frmSelect.submit();
-
}
-
-
//-->
-
</script>
-
-
</head>
-
<body>
-
<div id="menu">
-
<form method="Post">
-
<select name="navigate" onChange="window.location='manner.asp?PostCardID=' + this.options[this.selectedIndex].value">
-
-
<%
-
Set oRs=Server.CreateObject("adodb.recordset")
-
strSQL = "SELECT DISTINCT CardDescription FROM tblGreetingPostCards ORDER BY CardDescription"
-
oRs.Open strSQL, conn
-
-
Do while not oRs.EOF
-
if Request.Form("GreetingPostCards") = oRs("CardDescription") then 'if this is the selected one then display as selected
-
Response.Write "<OPTION VALUE = '" & oRS ("CardDescription") & "' SELECTED>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
else
-
Response.Write "<OPTION VALUE = '" & oRs ("CardDescription") & "'>"
-
Response.Write oRs("CardDescription") & "</Option>"
-
oRs.MoveNext
-
end if
-
loop
-
%>
-
</SELECT>
-
</form>
-
</div>
-
</body>
-
</html>
-
-
-
..asp
I dont know if that makes sence. I dont know if it can be done either. Maybe I have to get a dropdown thats linked with the same database link on the main page. That I havent been able to do so I linked from a seperate page, albeit with a different connection, still to the same database. Dont know if thats important.
probably confussed you even more.
Thanks again for your help
Richard
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Arpan |
last post by:
A link has the following URL:
<a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%=
Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2")
%>&cplace=<%= Request.QueryString("cplace") %>">Click</a>
Suppose the names in the above querystring have the following values:
cname="Danny"
cadd1="House 97"
|
by: Mikael |
last post by:
Hi All!
I have a problem here and i can't see what it is...
My parameters (value) are shopped off.
exampe "Hello world" will end up like "hello"
How should i adjust the syntax to get a whole string that is not shopped
off?
Thanks Mike
|
by: lion |
last post by:
my Problem:
a query string passed into a html page doesn't display correctly on a
mac
I am just using html and javascript (no ASP, PHP or server side
scripting)
This is the query string:
popup.html?pImage=30_leilani_dowding_b_060.jpg&ordRef=1000&Title=Leilani Dowding
using the QueryString function below, the pImage variable should be
|
by: David |
last post by:
Hello
I need to take some values and place them in a string in
the format of a querystring.
Lets say I have:
string State = "ACT";
string SearchString = "Tax";
int MinRelevance = 50;
|
by: Raterus |
last post by:
Howdy,
Simple question, but I can't figure out how to do it. I have a a page which is called initially with a querystring. After I get the querystring values, I don't need the querystring to appear in the url anymore. How can I get rid of it? A postback doesn't clear it, it just keeps tagging along. I tried Request.QueryString.Clear, but get "readonly" errors.
I want to do this, because eventually I use server.transfer within this...
| |
by: Alex |
last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ...
www.something.com/main.aspx?client
Client is the QueryString, but no value is given. This would mean to me that client exists, so its value is true. In the code behind, I can tell that client exists using Request.QueryString.Keys.Count, which equals 1....
|
by: Dan Sikorsky |
last post by:
How can I get the Querystring passed to the Referring Page from its
referrer?
I don't want the querystring coming to my current page. I want the
querystring that came to the referring page, so that I can check for the
existance of a parameter value in that previous querystring.
|
by: beebee |
last post by:
Hi all.
I am having a bit of difficulty:
Here is what is happening:
I have an application that spits out a thankyou.aspx page and i would like to pass it the querystring values it had collected before loading the thankyou page.
This is completed.
NOw on the thankyou.aspx page i am getting the following error:
Compiler Error Message: CS0120: An object reference is required for the nonstatic field, method, or property...
|
by: =?Utf-8?B?RVcgTmV3Ymll?= |
last post by:
My apologies in advance if there is a better forum for this question.
Given the following snippet:
<script type="text/c#" runat="server">
protected void Page_Load(Object Sender, EventArgs e)
{
if ( Request.QueryString.Count 0 )
{
if ( Request.QueryString != "" )
|
by: pingsheng |
last post by:
Dear all,
I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record must be submitted with a unique key, while everything is the same, these 4 fields must be different....
Idealy, these are the codes. please teach me how to do it.
objConn.Open(sConnection)
sRowNum = request.querystring("row_num")
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |