Discussion:
Check User session before display form search results
(too old to reply)
Paul_E21MEDIA
2007-03-17 16:00:35 UTC
Permalink
Hi,

I have a search form on my home page. However, I only wanted logged in
users to see the search results. It currently allows anyone to view
the search results. Have tried using something like:

If Session("UserID") = 0 Then response.redirect("/notloggedin.asp")

<form action="searchresult.asp" method="get" >

However, it only redirects to the login page, each time someone tries
to visit the site. I still want non members to view the home page,
just not the search results unless they sign up and then log in.
Teaser
2007-04-25 05:09:00 UTC
Permalink
Post by Paul_E21MEDIA
Hi,
I have a search form on my home page. However, I only wanted logged in
users to see the search results. It currently allows anyone to view
If Session("UserID") = 0 Then response.redirect("/notloggedin.asp")
<form action="searchresult.asp" method="get" >
However, it only redirects to the login page, each time someone tries
to visit the site. I still want non members to view the home page,
just not the search results unless they sign up and then log in.
I think the coorect statement is

If ltrim(Session("UserID")) = "" Then response.redirect("/
notloggedin.asp")

Loading...