|
| |
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
allowing clients to download files - Perl? PHP? - 1/6/2005 23:44:09
I need to create a link on my site which prompts for a username and password - I know I can do this with .htaccess and it will go to the directory and have done so BUT I need a step in the middle. I need to take the logger-iner direct to their own folder (ie out of the others that are there) from where they can download their images which I have put there for them. There will be several users, each with a different folder - of course they can't be able to see eachother's folders! At the moment the only way I can see is to give each of them their own link from which to log-in - this would look awful and also they don't need to know who else we work for. My server help desk helpfully said this.... > > You would need to search through script archice type sites like the one > > found > > at php.resourceindex.com and see if you can find something "off the shelf" > > > that is suitable.Once you have found one then if you like we can install > > it > > for you, our standard fee for installing scripts is $150 > > > > > > Regards, > > > > Martial Herbaut. > > ---------------------------------- > > Server101 > > Fast and Reliable Web Hosting! > > http://www.server101.com/ > > > > > > "Kristin" <kristinm@ihug.com.au> wrote: > > > > --Start Snip-- > > > >> No!!!! I did download a script but I have no idea what to do with it! I > >> need > >> > >> something with a front end - is there any (cheap) software? > >> ----- Original Message ----- > >> From: "S101 Support System" <support@server101.com> > >> To: "Kristin" <kristinm@ihug.com.au> > >> Sent: Friday, January 07, 2005 12:49 PM > >> Subject: [Ticket#: 2004112410000695] Re: ftp > >> > >> > >> > > >> > > >> > Ok I see, yes to facilitate that type of approach you will need a > >> > download > >> > >> > manager PERL or PHP based script. Do you have access to a programmer > >> > which > >> > >> > can > >> > help you with that sort of implementation? > >> > > >> > Regards, > >> > > >> > Martial Herbaut. Help anyone?????
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/7/2005 1:29:04
Ok here goes. Using .htaccess, you can do what you would like to. basicallty you need a javascript that has a login form. The form will then form a specific URL that will be in the form of a username/password. Then have the username be the folder name. And then when the form submits, it will take them to the folder, and their username/password will already be entered in, and thus they will be logged in. Javascript: <!-- 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 + username + "/";
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
// End --> Then use this: <form name=login>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px;">Username</td>
<td style="padding-left:12px;">
<input type="hidden" name="server" value="www.domain.com/">
<input type="text" name="username" style="width:80;height:20" size="20"></td>
</tr>
<tr>
<td style="font-size:10px;">Password</td>
<td style="padding-left:12px;">
<input type="password" name="password" style="width:80;height:20" size="20"></td>
</tr>
<tr>
<input type=image src="images/login.jpg" onClick="Login(this.form); return false;">
</tr>
</table>
</form> Make sure you edit the domain part, as well as make the username the same as the folder name.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/7/2005 4:46:25
omigod I think this is all beyond me!!!! Can you give me a step by step? I built my site using Dreamweaver, I wonder if any of the extensions or anything would work? Or if there is another piece of web building software I can use to build this page. I've set up a sub-domain so I can build the client page there. I haev the .htaccess and password files and it works when I direct the link to that one folder - but as I said I need the bit where it directs itself.
|
|
|
|
suzkaw
Posts: 161 From: North Carolina, USA Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/7/2005 10:24:19
This is just an idea but if you want to forward each person to their own directory which is their username you could use the dreamweaver login with a mysql database and where it forwards them just change the file to a variable of their username. Sort of like this: Original: header("Location: index.php"); New: header("Location: $_POST[username]");
_____________________________
Thanks, Eric 68 Classifieds
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/7/2005 19:12:07
You guys are SO lovely and I am such a DUNCE - I'm so out of my depth here. I guess being self-taught will only get you so far. How do I get that lovely javascript onto my page? I tried using java web start (which I've never used) it seems to want to put it on a notepad file which I then linked to in DWeaver and nothing happened... I tried using insert applet but that didn't work. Should I go out of Dreamweaver and just edit it in coffee cup or something? I thought about the database SQL thing too - and I've downloaded mysql, but really I have no idea about that either. I can't believe this is so difficult - it seems like it should be so easy! THere must be some front-end thing I can get hold of to do this... I'd loev to do it myself because then I'd know how.... but I could die of frustration first! I don't suppose one of you guys want to do it and I could pay you - I'm in Australia though....and I can't afford too much (although it would probably take you about ten minutes!). I'll try playing around with Suzkaw's thing now....watch me crash and burn
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/7/2005 21:50:59
I don't have FTP access where I am at. But you can either send me login details to your control panel (which will need to have some type of file manager to allow myself to edit files) or give me a message on AIM (in my profile). I'm up until around 4am.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 11:49:35
quote:
I tried using java web start (which I've never used) it seems to want to put it on a notepad file which I then linked to in DWeaver and nothing happened... I tried using insert applet but that didn't work. Should I go out of Dreamweaver and just edit it in coffee cup or something? sounds like you are confusing java and javascript - common misconception. The expression "applet" is unique to java and not applicable to js. so you are trying to use DW's java functions to enter js - wont work but DW does handle js nicely. What version of DW?
_____________________________
Dan
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 16:43:10
4.0 - so how do I get that onto the page? Cut&paste doesn't work
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 19:19:52
Copy the code, then paste it into the page... If you have the source code of the page, just post it here.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 21:51:38
I tried that - it just behaves like normal text
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 21:53:06
can we see the code you have tried pasting?
_____________________________
Dan
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 21:53:58
quote:
I tried that - it just behaves like normal text did you paste it into design view or html view? needs to be pasted in html view
_____________________________
Dan
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 21:58:46
In html view - I'm just using a blank page, once I get this working I'll build the page - its Bobby's script above
|
|
|
|
dpf
Posts: 7126 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:06:34
quote:
I'm just using a blank page well did you build a basic page with the minumum html tags? the first part of his code should go in the head section and the second part in the body. then save the file and open it in a browser, fill out the form and submit to test
_____________________________
Dan
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:11:17
OK - its just a blank DW page - so yes it has the basic stuff... do you mean the whole first bit goes in the head and then the next - ie then use this goes in the body?
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:15:14
Give me a sec, I'll just make working page for you.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:20:22
Copy/paste this into the source code view of your editor. Then replace the domain.com with your domain name. <html>
<head>
<title></title>
<!-- 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 + username + "/";
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
// End -->
</head>
<body>
<p>Welcome to my page designed in notepad on a 25 year old computer.</p>
<form name=login>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="font-size:10px;">Username</td>
<td style="padding-left:12px;">
<input type="hidden" name="server" value="domain.com/">
<input type="text" name="username" style="width:80;height:20" size="20"></td>
</tr>
<tr>
<td style="font-size:10px;">Password</td>
<td style="padding-left:12px;">
<input type="password" name="password" style="width:80;height:20" size="20"></td>
</tr>
<tr>
<input type=image src="images/login.jpg" onClick="Login(this.form); return false;">
</tr>
</table>
</form>
</body>
</html>
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:21:06
So where's the bit that takes them to the folder? (I'm not this thick usually you know!)
< Message edited by kristinm -- 1/8/2005 22:27:37 >
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:22:14
Can you upload this for us to see it not working? If you can, just make a temp user/pass for us to test.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:34:15
OK - its www.mwpics.com.au/clients - and I think it is working, I thought the login was server and the password password - oh sh*** I don't know what's happening@!
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:38:42
no way to tell how it works if you dont get us a user/pass
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:39:52
Oh sorry - I forgot about the old .htaccess file!!! - So I put that in the folder its directed to right? Hang on...
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:41:44
correct
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 22:55:01
You'll never believe this - now I can't get coffee cup to find my site - and apparently I can't upload those files using DW as it has to be done in ascii???? I'm still trying..
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 23:00:22
Ah, you will be keeping me busy tonight. It sounds like a problem on your side (unless your web server is down). Double check you are entering in the correct information into CoffeeCup. Once you can log in, I can tell you what to do next.
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 23:02:15
Well the trial version ran out so I downloaded the free one and now it can't seem to find the connection....
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/8/2005 23:46:17
OK - its all up there - but I can't seem to get the link right from your login to the folder
|
|
|
|
kristinm
Posts: 32 Joined: 11/17/2004 From: Sydney Australia Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/9/2005 0:00:55
the username is DJohnson and the password is ljh1 - I've called the folder it needs to go to DJohnson as well and put the .htaccess and password files in there.....???? But its not flipping over there - I feel I've missed something in your script I should have overwritten
< Message edited by kristinm -- 1/9/2005 0:35:17 >
|
|
|
|
BobbyDouglas
Posts: 5470 Joined: 5/15/2003 From: Arizona Status: offline
|
RE: allowing clients to download files - Perl? PHP? - 1/9/2005 0:32:30
Something is still mis-configured on your end. The username/password is not working for me when I visit: http://www.mwpics.com.au/clients/DJohnson Btw, it would be much easier if you just made a user named test with the password test. You are posting your user/pass on a public board, so its not like making something that secure will make a difference...
_____________________________
Arizona Web Design - Mr Bobs Web Design in Arizona The Arizona Web Hosting Challenge
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|