Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
SSJS Help Again, Sorry.
Old 09-05-2009, 01:00 PM SSJS Help Again, Sorry.
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
Hi,

Sorry, I thought I had it working, but no, the problem came back ...Since the original thread got deleted, here's the issue:

This is the login page done in server side java script:

Code:
if(user.number==0 || user.number==system.matchuser('Guest')) {
	http_reply.status='401 Permission Denied';
	http_reply.header["WWW-Authenticate"]='Basic realm="'+system.name+'"';
}
else {
// Note: A 302 here would mean the index would be displayed as "/login.ssjs"
// That is to say, it would display the index AS login.ssjs.
	// http_reply.status='302 Found';
	http_reply.status='302 Temporary Redirect';
}
http_reply.header.location='/index.ssjs';
http_reply.header.pragma='no-cache';
http_reply.header.expires='0';
http_reply.header['cache-control']='must-revalidate';

writeln('<html>');
writeln('<head>');
writeln('</head>');
writeln('<body>Logging in to <a href="/">'+system.name+'</a></body>');
writeln('</html>');
Ok, I have two text boxes, one for the user name, and one for the password, with a submit button. When I enter a valid username / password, I get the 'basic realm' authentication box. How do I avoid that?

Here's the html to login:

Code:
<form name="form1" method="post" action="/login.ssjs">
User Name: <input class="loginbox" type="text" name="form1" alt="Username" />
Password: <input class="loginbox" type="password" name="form1" alt="Password" /> 
<input type="submit" name="form1" value="Login" />
Side note: If I enter the correct username / password in the 'basic realm' dialog box, I get another dialog that says:
Quote:
This webpage is being
redirected to a new location. Would you like to resend the form data
you have typed to the new location?
I will be able to login normally from that, but how do I eliminate that altogether?

Thanks again!
-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-05-2009, 05:12 PM Re: SSJS Help Again, Sorry.
Brian07002's Avatar
Defies a Status

Posts: 2,140
Name: ...
Location: ...
Trades: 0
anyone?
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to SSJS Help Again, Sorry.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09480 seconds with 12 queries