Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to hide navigator menus on webpage

Status
Not open for further replies.

williamsba

Programmer
Aug 3, 2000
57
US
Heres what I am trying to do. I have a log-in page to a secure area that only certain people should see. I would like that log-in page to have the address bar disappear so that the user can't just type the path to the page they want to get to. Now I know theres probably other ways to do this, so any info on this problem would be great. Thank you... Brad Williams
Webmaster
2d Force Service Support Group
United States Marine Corps
 
Unless you open it in a popup window, you will not be able to do this... even then, you would need a redirect cgi or asp script to prevent people from just viewing the source and typing in the address. my solution to it was setting a session long cookie in ASP which I check for on any of the secured pages. if the person arriving at the page doesn't have a cookie saying its ok, I send them away to another page.. jared@aauser.com
 
How did you initially get the cookie on the users that should be viewing it?? You did this when they log in? Would you happen to know of a sample page I could view to see this process? Brad Williams
Webmaster
2d Force Service Support Group
United States Marine Corps
 
has some good client side cookie scripts.

but if you want your login to be more secure i would suggest using server-side code.

using JScript it would look something like this.


<%@Language=JScript%>
<%
var uid = Request.Form('userid');
var pwd = Request.Form('passwd');

//check passwd and uid.
if(uid == 'correctuid' && pwd == 'correctpwd')
{
Response.Cookies(&quot;user&quot;)(&quot;userid&quot;) = &quot;good&quot;;
Response.Redirect(&quot;securepage.htm&quot;);
}
else
{
Response.Redirect(&quot;}
%>

this is an asp that your login page would post to.

then the code on your secure pages, which would all have to be asp as well,

<%@Language=JScript%>
<%
cookie = Request.Cookies(&quot;user&quot;)(&quot;userid&quot;);

if(cookie != &quot;good&quot;)
{
Response.Redirect(&quot;loginpage.htm&quot;);
}
else
{
%>
<!-- html content here -->
<%
}
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top