navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Only Want to Return Listings for User

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Only Want to Return Listings for User
Page: [1]
 
nettop

 

Posts: 212
Joined: 2/9/2004
Status: offline

 
Only Want to Return Listings for User - 3/9/2008 20:13:07   
I have a website where users register using the Spooky Login. I have sessions turned on. After a person is authorized, they enter new listings. I would like to show a page of just THEIR listings, so that I can let them edit only THEIR OWN listings. Thanks for your help, Tim

Here's my code (highlighted in red is where I'm trying to match the field name Agent_Email to the Session Name (which is the Spooky UserName):
<% ON ERROR RESUME NEXT
If cint(Session("AccessLevel")) < 3 Then 
Response.redirect "/authorized.asp?Redirect=" &Request.Servervariables("URL")
End if 
%>
<%
Dim mySessionUserName
mySessionUserName = Session.SessionUserName
%>
<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- View</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body bgcolor="#FFFFFF">

<table width="100%" align=left>
  <tr>
    <td width="50%">
	  <b><font size=+3 color="#000080"> Results Page </font></b>
	</td>
    <td width="50%" align=right>
      <table>
        <tr>
          <td>
		My Listings Page
| <a target="_top" href="editor/new.asp">Submission Form</a>
          </td>
        </tr>
      </table>
	</td>
  </tr>
</table>


<p>
<br clear="all">
<hr>
<p><% =Session("UserName") %>'s Listings With Paramount</p>
<table width="100%" border="1">
	<thead>
		<tr>
			<th ALIGN="LEFT"><b>ID</b></th>
			<th ALIGN="LEFT"><b>Agent_Email</b></th>
			<th ALIGN="LEFT"><b>Agent_Name</b></th>
			<th ALIGN="LEFT"><b>Owners_First_Name</b></th>
			<th ALIGN="LEFT"><b>Owners_Last_Name</b></th>
			<th ALIGN="LEFT"><b>Business_name</b></th>
			<th ALIGN="LEFT"><b>Street_Address</b></th>
			<th ALIGN="LEFT"><b>City</b></th>
			<th ALIGN="LEFT"><b>State</b></th>
			<th ALIGN="LEFT"><b>Status</b></th>
		</tr>
	</thead>
	<tbody>
		<!--#include file="../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<% end if %>
[color=#FF0000]<%
fp_sQry="SELECT * FROM Results WHERE (Agent_Email =  'Session(""UserName"")') ORDER BY ID DESC"[/color]fp_sDefault=""
fp_sNoRecords="<tr><td colspan=10 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="new"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&VTI-GROUP=202&Owners_First_Name=202&Owners_Last_Name=202&Spouses_Name=202&Owners_Mailing_Address=202&Owners_City=202&Owners_State=202&Owners_Zip=202&Owners_Home_Phone=202&Owners_Cell_Phone=202&Owners_Fax=202&Owners_Email1=202&Owners_Email2=202&Description_and_price=202&Business_name=202&Street_Address=202&City=202&State=202&Zip=202&Detailed_Description=203&Type=202&Type_Number=202&Price=3&Area=202&Area_Number=202&Status=202&Status_Number=202&Page=202&Revenues=3&Adjusted_Net=3&Agent_Name=202&Agent_Email=202&Agent_Phone=202&Timestamp=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp1=135&"
fp_iDisplayCols=10
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../_fpclass/fpdbrgn1.inc"-->
<tr>
			<td>
			<%=FP_FieldVal(fp_rs,"ID")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"Agent_Email")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"Agent_Name")%></td>
			<td>
<%=FP_FieldVal(fp_rs,"Owners_First_Name")%></td>
			<td>
<%=FP_FieldVal(fp_rs,"Owners_Last_Name")%></td>
			<td>
<%=FP_FieldVal(fp_rs,"Business_name")%></td>
			<td>
<%=FP_FieldVal(fp_rs,"Street_Address")%></td>
			<td>
<%=FP_FieldVal(fp_rs,"City")%></td>
			<td>
<%=FP_FieldVal(fp_rs,"State")%></td>
			<td>
<%=FP_FieldVal(fp_rs,"Status")%></td>
		</tr>
<!--#include file="../../_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>
</body>
</html>


< Message edited by Spooky -- 3/9/2008 20:29:18 >
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Only Want to Return Listings for User - 3/9/2008 20:30:36   
Try it like so?

fp_sQry="SELECT * FROM Results WHERE (Agent_Email =  '"&Session("UserName")&"') ORDER BY ID DESC"


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to nettop)
nettop

 

Posts: 212
Joined: 2/9/2004
Status: offline

 
RE: Only Want to Return Listings for User - 3/10/2008 0:00:35   
Perfecto...I'm starting to get this 'sessions' thing down. The Spooky login tool has so MANY wonderful applications. Thanks for all of your hard work and help. Tim

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Only Want to Return Listings for User
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts