choobakka Posted March 15, 2006 Share Posted March 15, 2006 i have been working through this tutorial which i have which shows you how to create a complete website/blog/forum using Dreamweaver and ASP. i have it working exactly as i want except for one thing:i have one page which pulls all of the data from an MS Access database table and presents it on the webpage. when i click on the ID number of each row, i am taken to another webpage where i am presented with the records related only to that ID. on this 2nd page i am able to edit the details and submit them back to the database.the third webpage i have is a login page which interacts with the database. however, this login feature will only take me to the first record in the table and allow me to edit it (page 2)what i would like to happen is to completely bypass the first page (with the complete table) and have the user login with their username and password and then they would be directly presented with their related data to edit and resubmit to the database.how can i do this? Link to comment Share on other sites More sharing options...
Xenon Design Posted March 17, 2006 Share Posted March 17, 2006 Ok from what I can gather is that you want the user to login and the first page they are presented with their profile??If so...You need to create a recordset which gets the information from the session (assuming you have set up a user session in your login script)Heres what your SQL for retrieving the info should look like: sql="SELECT * FROM users WHERE username='"&Session("user")&"'" That will select the records for the user. You may have your session and table name and so on different so adjust this SQL accordingly. Link to comment Share on other sites More sharing options...
choobakka Posted March 18, 2006 Author Share Posted March 18, 2006 how would i create a session. i dont think ive set up a session for the login. all they do is login and then be presented with the first row in the table (ie not specific to them) Link to comment Share on other sites More sharing options...
Xenon Design Posted March 18, 2006 Share Posted March 18, 2006 In my tutorial on the login script it sets a session. Best to have a look at it. The link to it is in my sig Link to comment Share on other sites More sharing options...
choobakka Posted March 19, 2006 Author Share Posted March 19, 2006 do you know how i would do this in dreamweaver?my login form is called frmLogin with fields 'username' and 'password' if that helps. in dreamweaver a session has been created called 'MM_Username'. there are other sessions but im assuming this is the one i need to work with!any ideas? Link to comment Share on other sites More sharing options...
Xenon Design Posted March 19, 2006 Share Posted March 19, 2006 Yes dreamweaver uses the session name 'MM_Username' ...I have decided a week ago to write my own scripts. So far I find it is better because you rmore free to do things.But if your new to ASP stick to DWeaver and their premade scripts Link to comment Share on other sites More sharing options...
choobakka Posted March 19, 2006 Author Share Posted March 19, 2006 yes i am fairly new to ASP. so any ideas how i can do it on dreamwaver (ie what stages i need to go through)!thanks Link to comment Share on other sites More sharing options...
Xenon Design Posted March 20, 2006 Share Posted March 20, 2006 Well Dreamweaver has an inbuilt user system. Which are scripts like the login and 'Check user is logged in' scripts. Also some other little ones aswell.Really tutorials are a really big help when your trying to make a major ASP project when your new. A simple Google search on ASP tutorials will help you.I myself am making a forum and blog in ASP with all my own code and ive built it similar to Invision Pover Board. Link to comment Share on other sites More sharing options...
choobakka Posted March 20, 2006 Author Share Posted March 20, 2006 ok thanks i will check out the tutorials. but could you please help me with one thing? if my session has already been created (mm_username), what would the sql statement look like for recordset? Link to comment Share on other sites More sharing options...
choobakka Posted March 20, 2006 Author Share Posted March 20, 2006 i typed the follwing SQL statement is dreamweaver for a recordset:SELECT * FROM tblCustomer WHERE username = '"&Session("MM_Username")&"'"i get the following error message when i try and test the recordset:Syntax error in string in query 'username = '"&Session("MM_Username")&"'"'any ideas? Link to comment Share on other sites More sharing options...
Xenon Design Posted March 21, 2006 Share Posted March 21, 2006 Oops i put ' in the SQL :sSELECT * FROM tblCustomer WHERE username = "&Session("MM_Username")&"" <- Replace with that code Link to comment Share on other sites More sharing options...
choobakka Posted March 21, 2006 Author Share Posted March 21, 2006 i tried that. i get the following message:Syntax error (missing operator) in query expression 'username = "&Session("MM_Username")&"" Link to comment Share on other sites More sharing options...
pulpfiction Posted March 21, 2006 Share Posted March 21, 2006 dim uname,SQLuname=session("MM_Username")SQL = "SELECT * FROM TBLCustomer WHERE username='" & uname & "'"Try this statement, to check if the statement is correct, jus print the statement and see if it comes out correct....response.write(SQL)HTH Link to comment Share on other sites More sharing options...
choobakka Posted March 21, 2006 Author Share Posted March 21, 2006 im using dreamweaver. how/where would i do that? Link to comment Share on other sites More sharing options...
choobakka Posted March 23, 2006 Author Share Posted March 23, 2006 anybody? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now