close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

insert client problems

Thread began 2/01/2010 6:24 pm by mr hankey | Last modified 2/08/2010 7:56 pm by Eric Mittman | 818 views | 7 replies |

mr hankey

insert client problems

hi,

i am sure i have covered this before but i am having trouble with it:

i have a users tbl and client tbl

in client tbl i have a column users_clients which is foreign key between the 2

i have made this hidden in my insert page, i want it to auto associate with the user who has logged in that has added the client. How would i do this, as i then want to display that users results only in the results page.

so that user can only see his own and no one elses. hope you can help, i am trying to think is it to do with binding a session variable from the login page to this page and if so could you just walk me through the steps please?

many thanks

Sign in to reply to this post

Eric Mittman

On your login page you should have the Authenticate user server behavior. In here you need to make sure that you are storing the UserID in a session variable.

Once you have done that you can then reference this session variable for the userID in your inserts. You just select the UserID session variable as the value for your users_clients column using the lightning bolt.

Sign in to reply to this post

mr hankey

hi eric,

i managed to get it working using the session variable from login page, however when you go to the clients details it shows assigned to "1" instead of the users name, how can i change it to show the username for that userid?

i also want it to only show the users clients not everyones. however administrator should see all if possible?

many thanks

Sign in to reply to this post

Eric Mittman

In order to get the id to update to be the username you will need to have a recordset that selects from your users table where the userID is equal to the recordset value on this details page. When you have the recordset on the page that is filtered on this user id you can use the user name binding in place of the id value that is present.

If you want to limit the records that are seen to only the user that is logged in you will need to filter on the session userID value you used in the insert. If you want the admin to see all of the records then you will either need to make a separate results page for the admin or add in another recordset to the current results page, then use an if statement to use one or the other. I think it would be easiest to make an admin all users results page that does not filter on the userID.

Sign in to reply to this post

mr hankey

what about security assist access levels? could this be used here and how?

again eric, many thanks

Sign in to reply to this post

Eric Mittman

Depending on how you have your rules setup you could make use of the Security Assist show region. You need to have your rules setup so that your admin is not also a user otherwise both recordsets would exist on the page if you were an admin and this would cause problems.

If you have the rules setup like this then you can add both the filtered and non filtered recordset onto the page and use the show region to have one show only for admin users (the non filtered one) and the other show for the regular users.

Sign in to reply to this post

mr hankey

hi eric,

can you give me some detiled instructions on how to achieve showing username instead of userid.

i tested it with 1 account and it worked no problem, added a second user and they added a client and it showed still in the assigned to box as my username and not theres?

can you help where i am going wrong with this?

many thanks

Sign in to reply to this post

Eric Mittman

What are you currently doing on this page to associate the user with the client? If you are ensuring that the user must be logged in first and that the userID is held in a session variable then you should be using this session variable when inserting a client.

Please describe what you are doing on this page and how you are associating the id. Also, in the db what is the value that is held in these records for the user and client? Please also post back with a copy of the page in question so it can be reviewed.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...