Jump to content

Archived

This topic is now archived and is closed to further replies.

firmemente

php for ftp login

Recommended Posts

i have a page.... universalmailing.com/login.html

i set up a specific directoty folder named FIRME

the id is firmemente
pass is mentefirme

i want the user when he types in his id and pass that it will open only his folder where he can upload or download files. i am new to php!!!! is there a php code to do this? any help will be greatly appreciated.

Share this post


Link to post
Share on other sites
PHP is server side not client side. So any ftp coding you do will be in relation to the server not the clients box. Most you can do with php is setup a link to the ftp server and they can move files manually themselves.

Example
[code]<?php
$username = "username";
$password = "password";
echo '<a href="ftp://'.$username.':'.$password.'@ftp_site_address/folder_to_go_to"> Login </a>';
?>[/code]

Only thing is they will be able to hit button to go to parent directory if they have access to it.

You should restrict what they can see thru the ftp server software and not php

Ray

Share this post


Link to post
Share on other sites
If you have a login script, and that login script contains the username and password for the ftp, you can use this link on any page you want. It is just a link.

Share this post


Link to post
Share on other sites
<?php
$username = "firmemente.universalmailing.com";
$password = "mentefirme";
echo '<a href="ftp://'.$username.':'.$password.'@www.universalmailing.com"> Login </a>';
?>

this is what i did. if this is how it is .... the page is blank.

Share this post


Link to post
Share on other sites
you would have to do this

[code]<?php
$site = "firmemente.universalmailing.com"
$username = "firmemente";
$password = "mentefirme";
echo '<a href="ftp://'.$username.':'.$password.'@'.$site.'"> Login to ftp </a>';
?>[/code]

Share this post


Link to post
Share on other sites
i tried it... but still getting blank page

for $site should it not be "www.universalmailing.com"

ftp://firmemente.universalmailing.com@wwww.universalmailing.com
(this is what the client has to type in to get into their folder)

i apologize.... the actual id is firmemente.universalmailing.com

when a pop up window shows up:
id: firmemente.universalmailing.com
pass: mentefirme

from universalmailing.com/login.html
id: firmemente.universalmailing.com
pass: mentefirme

so then......

<?php
$site  =  "www.universalmailing.com"
$username  =  "firmemente.universalmailing.com" ;
$password  =  "mentefirme" ;
echo  '<a href="ftp://' .$username .':' .$password .'@' .$site .'"> Login to ftp </a>' ;
?>

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.