Jump to content


Photo

php for ftp login


  • Please log in to reply
6 replies to this topic

#1 firmemente

firmemente
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 06 October 2006 - 05:05 PM

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.

#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 06 October 2006 - 05:51 PM

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
<?php
$username = "username";
$password = "password";
echo '<a href="ftp://'.$username.':'.$password.'@ftp_site_address/folder_to_go_to"> Login </a>';
?>

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

#3 firmemente

firmemente
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 06 October 2006 - 06:01 PM

is the sample above what i would put on the ftp.php

#4 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 06 October 2006 - 06:41 PM

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.

#5 firmemente

firmemente
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 06 October 2006 - 07:01 PM

<?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.

#6 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 06 October 2006 - 07:40 PM

you would have to do this

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


#7 firmemente

firmemente
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 06 October 2006 - 08:01 PM

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>' ;
?>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users