Jump to content

php for ftp login


firmemente

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.
Link to comment
https://forums.phpfreaks.com/topic/23194-php-for-ftp-login/
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
Link to comment
https://forums.phpfreaks.com/topic/23194-php-for-ftp-login/#findComment-105173
Share on other sites

i tried it... but still getting blank page

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

ftp://[email protected]
(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>' ;
?>
Link to comment
https://forums.phpfreaks.com/topic/23194-php-for-ftp-login/#findComment-105246
Share on other sites

Archived

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

×
×
  • Create New...

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.