Current location: Hot Scripts Forums » Programming Languages » Perl » Interfacing a form with .htaccess


Interfacing a form with .htaccess

Reply
  #1 (permalink)  
Old 02-17-04, 12:47 PM
awohld awohld is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Interfacing a form with .htaccess

I want to use a form based login for .htaccess instead of the popup window that automatically comes up when you try to access the password protected directory.

Is this possible with perl and how do you do it?

Thanks
Adam
Reply With Quote
  #2 (permalink)  
Old 02-20-04, 03:01 PM
awohld awohld is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

FYI, here's the answer, you can do it simply in javascript. This javascript interfaces to the .htaccess dialog box. Or you could do it with perl as seen here: http://search.cpan.org/~sherzodr/CGI...m#MEMBERS_AREA


<!-- TWO STEPS TO INSTALL HTACCESS LOGIN:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Based on FTP log in by: Reinout Verkerk -->
<!-- Original: Gordon Hudson (sales@hostroute.com) -->
<!-- Web Site: http://www.hostroute.com/ -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<!-- The hidden form field "server" needs to be the
address of your password protected directory. -->

<form name=login>
<input type="hidden" name="server" value="www.domain.com/secure/">
Username:
<input type=text name=username size=20>
<br><br>
Password:
<input type=password name=password size=20>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</form>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.58 KB -->
Reply With Quote
  #3 (permalink)  
Old 02-23-05, 01:40 PM
yesk yesk is offline
New Member
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Interfacing a form with .htaccess

Hi awohld ,

The script is working good in the preview of a HTML editor but isnt working in a web browser...

Do you know why occurs that?
Thanks for advance
Cheers
Yessica
Reply With Quote
  #4 (permalink)  
Old 04-30-05, 05:16 PM
steelwidow steelwidow is offline
New Member
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
You're absolutely right! I've spent hours trying to figure this out.

It works in preview but not in a regular browser. I've been reading on this for awhile and have read somewhere that it's the security update that was applied to IE6.

If that's correct then there has to be a fix for this.

I'll see if I can find something.
Reply With Quote
  #5 (permalink)  
Old 04-30-05, 06:40 PM
steelwidow steelwidow is offline
New Member
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
found it

http://support.microsoft.com/default...b;en-us;834489

here's the fix for the microsoft browser within your form, but I don't know where to put it in my form... I mean I think I do , but MAN!

Also, this problem isn't a problem using firefox browser. BUT try telling your people to login only using firefox and they'll laugh at you.

We need something that's configured to both. I've got a php program but man what a pain in the "you know what".

SteelWidow
http://www.swdesignshosting.com

Last edited by steelwidow; 04-30-05 at 07:01 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
formmail problem gscraper Perl 12 08-27-04 03:06 AM
how do i re-fill the html form??? gaurav_sting PHP 1 12-21-03 12:13 PM
submit form? tcooper PHP 5 12-12-03 03:30 PM
SQL database registration form help vinhkhuong PHP 3 10-10-03 03:49 AM
asp: URGENT! need to change code to create new form per id seala ASP 2 09-09-03 09:54 PM


All times are GMT -5. The time now is 04:57 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.