Forums
This topic is locked
Introducing myself also have a little problem
Posted 15 Oct 2002 15:21:39
1
has voted
15 Oct 2002 15:21:39 Adam Hussain posted:
Hi everyone my name's Adam. I've just recently started developing web applications using dreamwever MX and ASP. I don't know how to code in ASP so I've been using a lot of the extensions and server behaviours provided. Thank god for extensions otherwise it would be a no hope situation <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>Anyway like I said, I don't know how to code in ASP but I can if need be.
I have a few problems:
1. I have a view record page but if the record is empty it doesn't display the page but instead comes up with an error. How can I rectify this?
2. I've used the login server behaviour (LOGIN USER), where I have provided a field for user ID and password, how do I then use this infomation to create a simple welcome
<b>Adam</b> page.
Sorry if I sound like I'm hopeless but I've been reading everything in the help manuals and online docs that I think it's going to be too complicated for me to do.
Chat to you guys later <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replies
Replied 15 Oct 2002 16:33:13
15 Oct 2002 16:33:13 Stefan P replied:
Hi Adam, welcome
Your first question is simple to resolve. Highlight the results in your web page and goto the Server Behaviour "Show region if recordset is not empty"
The second question is a little more tricky because you need to 'capture' session details in a variable. Dreamweaver creates a session variable called "MM_Username" on the login page. What you need to do on your welcome page is capture this in a variable. Use this code at the top of your welcome page:
<% USER = Session.Contents(CStr("MM_Username"
) %>
where USER captures the session variable
Then you need to create a users recordset with SQL similar to this:
SELECT UserID, FirstName, Username
FROM Users
WHERE Username='USER'
The last stage is to place the visitor's name on the page from the Data Binding panel.
This is a basic overview of what's needed but if, as you say, you are inexperienced you may need to 'play' around a bit to get things working
Hope this helps.
Stefan
UD4 | ASP | VBScript | ACCESS | IIS5
Edited by - sesame on 15 Oct 2002 16:34:36
Your first question is simple to resolve. Highlight the results in your web page and goto the Server Behaviour "Show region if recordset is not empty"
The second question is a little more tricky because you need to 'capture' session details in a variable. Dreamweaver creates a session variable called "MM_Username" on the login page. What you need to do on your welcome page is capture this in a variable. Use this code at the top of your welcome page:
<% USER = Session.Contents(CStr("MM_Username"

where USER captures the session variable
Then you need to create a users recordset with SQL similar to this:
SELECT UserID, FirstName, Username
FROM Users
WHERE Username='USER'
The last stage is to place the visitor's name on the page from the Data Binding panel.
This is a basic overview of what's needed but if, as you say, you are inexperienced you may need to 'play' around a bit to get things working
Hope this helps.
Stefan
UD4 | ASP | VBScript | ACCESS | IIS5
Edited by - sesame on 15 Oct 2002 16:34:36
Replied 15 Oct 2002 20:14:08
15 Oct 2002 20:14:08 Adam Hussain replied:
Thanks alot mate.
Hey I never accessed this website from home but at work. Today I saved this webpage on my floppy disc then took it home. After loading it I found that I didn't need to type my username or password it just logged me in as my username... is it suppose to do that?
Hey I never accessed this website from home but at work. Today I saved this webpage on my floppy disc then took it home. After loading it I found that I didn't need to type my username or password it just logged me in as my username... is it suppose to do that?