Ask a Question related to ASP Database, Design and Development.
-
Kris Eiben #1
Re: how to control the right of html accessing
Use asp or jsp for ALL pages you want to protect, so you can include
server-side code. Then, at the top of every restricted page, check to
make sure the user has access to the page -- and if not, redirect to a
"sorry, you need to log in" page. That way, if the user's not logged
in, he will never see the content of the page even if he has bookmarked
the URL.
An example using session variables, assuming all users with rights can
see all pages:
1) Store the user's ID in a session variable when he first logs in
Session("userID") = whatever
2) On the top of each page:
' set up connection
SQL = "Select userID from user_rights where userID = " &
Session("userID")
set rs = conn.Execute(SQL)
if rs.EOF then
' clean up recordset and connection
response.redirect "YouNeedToLogin.asp"
end if
'rest of page goes here
You could improve this login procedure by sending a querystring variable
to the YouNeedToLogin page, so that when the user logs in you can return
him to the page he was trying to access.
"jack" <fei_ying@21cn.com> wrote in message
news:08cc01c34503$d7435b40$a301280a@phx.gbl...> i have a task as following:
> some body has right to access an html page,some body has
> no right,these right information
>
> are in database...sounds simple,get information from
> database,verify if the user has that
>
> right,then go to that page or not go to.......but if i
> programme on server using asp or
>
> jsp,at the end ,i need to use the url where is the place
> of that html,so user ALWAYS can
>
> input that url directly into the browser to access that
> html,that 's the question....anybody
>
> can help me????
Kris Eiben Guest
-
Accessing swf or javascript in different html
Hi, From my understanding, the swf instance can communicate with other swf instance through the LocalConnection class. Also, the flex application... -
accessing html fields
I have an input field defined outside the <form> area. Its a simple html text input that is used to enter the number of hours. <input... -
How do I get a custom Control Designer to write to the HTML of my control?
I have created a custom 'Control Designer' that provids a popup dialog for entering more complex properties (such as property builder in the data... -
Accessing values of one customer Control from another custom control
Hi All, I am a newbie in creating ASP.NET custom controls. I have created one custom control say X.ascx for getting the location of the user like... -
how to control the right of accessing html
i have a task as following: some body has right to access an html page,some body has no right,these right information are in database...sounds... -
jack #2
Re: how to control the right of html accessing
can include>-----Original Message-----
>Use asp or jsp for ALL pages you want to protect, so youpage, check to>server-side code. Then, at the top of every restrictedredirect to a>make sure the user has access to the page -- and if not,user's not logged>"sorry, you need to log in" page. That way, if thehas bookmarked>in, he will never see the content of the page even if hewith rights can>the URL.
>
>An example using session variables, assuming all usersfirst logs in>see all pages:
>1) Store the user's ID in a session variable when heuserID = " &> Session("userID") = whatever
>2) On the top of each page:
> ' set up connection
> SQL = "Select userID from user_rights wherequerystring variable>Session("userID")
> set rs = conn.Execute(SQL)
> if rs.EOF then
> ' clean up recordset and connection
> response.redirect "YouNeedToLogin.asp"
> end if
> 'rest of page goes here
>
>You could improve this login procedure by sending ayou can return>to the YouNeedToLogin page, so that when the user logs in>him to the page he was trying to access.
>
>"jack" <fei_ying@21cn.com> wrote in message
>news:08cc01c34503$d7435b40$a301280a@phx.gbl...>>> i have a task as following:
>> some body has right to access an html page,some body has
>> no right,these right information
>>
>> are in database...sounds simple,get information from
>> database,verify if the user has that
>>
>> right,then go to that page or not go to.......but if i
>> programme on server using asp or
>>
>> jsp,at the end ,i need to use the url where is the place
>> of that html,so user ALWAYS can
>>
>> input that url directly into the browser to access that
>> html,that 's the question....anybody
>>
>> can help me????
>
>.
>jack Guest
-
jack #3
Re: how to control the right of html accessing
thank you ,very much
can include>-----Original Message-----
>Use asp or jsp for ALL pages you want to protect, so youpage, check to>server-side code. Then, at the top of every restrictedredirect to a>make sure the user has access to the page -- and if not,user's not logged>"sorry, you need to log in" page. That way, if thehas bookmarked>in, he will never see the content of the page even if hewith rights can>the URL.
>
>An example using session variables, assuming all usersfirst logs in>see all pages:
>1) Store the user's ID in a session variable when heuserID = " &> Session("userID") = whatever
>2) On the top of each page:
> ' set up connection
> SQL = "Select userID from user_rights wherequerystring variable>Session("userID")
> set rs = conn.Execute(SQL)
> if rs.EOF then
> ' clean up recordset and connection
> response.redirect "YouNeedToLogin.asp"
> end if
> 'rest of page goes here
>
>You could improve this login procedure by sending ayou can return>to the YouNeedToLogin page, so that when the user logs in>him to the page he was trying to access.
>
>"jack" <fei_ying@21cn.com> wrote in message
>news:08cc01c34503$d7435b40$a301280a@phx.gbl...>>> i have a task as following:
>> some body has right to access an html page,some body has
>> no right,these right information
>>
>> are in database...sounds simple,get information from
>> database,verify if the user has that
>>
>> right,then go to that page or not go to.......but if i
>> programme on server using asp or
>>
>> jsp,at the end ,i need to use the url where is the place
>> of that html,so user ALWAYS can
>>
>> input that url directly into the browser to access that
>> html,that 's the question....anybody
>>
>> can help me????
>
>.
>jack Guest



Reply With Quote

