Browser Based Ftp Login - HTML Page Where Users Type In A Username And Password
First let me say that I don't really know PHP at all. What I want to do is have an HTML page where users type in a username and password. After they click submit they are redirected to
"ftp://username:password@domain.com" where they can download and upload files to their folder.
Each username will have a folder in the directory that has the same name as the username. `So if "Mark" logs in, I want him to see the contents of the "Mark" folder where he can upload and download files. I don't want him to have access to anything else.
As I know nothing, I did a lot of reading up and researching on how to do this (lots of great information on this site by the way) but the PHP code might still be way off.
Here is the code I have so far:
for the html login page:
<html>
<body>
<form name="form" method="post" action="ftp.php">
Username: <input name="username" type="text" size="30">
Password: <input name="password" type="password" size="30">
<input type="Submit" size="8" value="Submit"></p>
</form>
</body>
</html>
the code for the ftp.php page is :
<?php
$ftp_server = 'domain.com' //domain being the future website domain
$ftp_username =$_POST['username'];
$ftp_password =$_POST['password'];
$location = 'ftp://$ftp_username:$ftp_password@$ftp_server'
header('Location: $location');
$ftp_connect_id = ftp_connect($ftp_server);
$ftp_login = ftp_login($ftp_connect_id, $ftp_username, $ftp_password);
if (! $ftp_connect_id || ! $ftp_login)
{
echo "Unable to connect to ".$ftp_server;
exit;
} else {
echo "Connected to host "<p>";
}
ftp_close($ftp_connect_id);
?>
right now, when i check it, I log on the html page and go the the php page where all it says is "Connected to host."
I don't see the "ftp://username:password@domain.com" that I want to see.
View Complete Forum Thread with Replies
Related Forum Messages:
Trying To Create A Login Page Username Password...
i would like to control acces using username password login page, on my host they are using myphpadmin and i was able to create the DB but using dreamweaver i cant see the tables. Where to start, is there any tools that will facilitate this request, or am i doing something wrong with dreamweaver.
View Replies !
Redirect Browser With Username And Password
I want to redirect browser with username and password, but following code does not work header("Location: http://userassword@21.22.39.54/t.dat"); browser still pop up a window asking for username and password. is there anyone can help me out with that?
View Replies !
Username/Password Login
I wrote a script on localhost WAMP, that collects the HTML source (with file_get_contents($url) and regex) from my favorite sites and puts it all together (for my own personal use), so I don't have to manually visit each site to read all that I need to read. However, it does not work if the site has a username/password login form (html form, not Apache "basic authentication").
View Replies !
Looking For Username Password Login Component
I'm developing a webapp that needs to track users and provide each user with a view of their own data. In other words, it goes beyond merely protecting certain areas of the site. The application needs to know WHO is logged in and show them their own blog, uploaded documents, reminders, etc. Code:
View Replies !
How Do I Retrieve Images Dynamically Based On The Login Username?
I have created a site in Joomla with a login (no self registration, users are provided with username and password by the admin). The users are supposed to login to a specific page where they can see 4 images. I have the following code: <?php // define directory path $dir = "images/user1/"; // iterate through files // look for JPEGs if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if (preg_match("/.jpg/", $file)) { // read EXIF headers $exif = exif_read_data($file, 0, true); echo "<tr>"; // get thumbnail // link to full image echo "<td valign=top><a href=$dir/$file><imgsrc=thumbnail.php?file=$file></a><td>"; echo "<td valign=top><font size=-1>"; // get file name echo "File: <b>" . $exif['FILE']['FileName'] . "</b><br/>"; // get timestamp echo "Timestamp: " . $exif['IFD0']['DateTime'] . "<br/>"; // get image dimensions echo "Dimensions: " . $exif['COMPUTED']['Height'] . " x " . $exif['COMPUTED']['Height'] . " <br/>"; // get camera make and model echo "Camera: " . $exif['IFD0']['Model']; echo "</font></td>"; echo "</tr>"; } } closedir($dh); } } ?> The question now is how to change the code to dimamically replace the folder name by the login username used. For example....if user2 logs in the images loaded will be only those in the folder images/user2, if user3 logs in it will be from the folder images/user3, etc... I am a little confused as to how to implement that in Joomla but as long as I have the code right I thinkI can just insert the code into the appropriate page using a mambot. If anybody here has any tips on how to accomplish that it would be extremely appreciated.
View Replies !
Make A Login Form (Username / Password Authentication)
Im trying to make a login form (Username / Password Authentication) and for each user that has a login / password they will be redirected to a specific page.. for example if the user "Mike" log's in he will be directed to page1. If the user "Jon" log's in he will be directed to page2. And really the only login i know how to do is to direct all users to one location..
View Replies !
How To Code The Login So As It Remembers The Password/username Of The Members.
I don't know if I have put this in the right place, but please help me even if it isn't. I want to have a 'members only' part to my site, but I don't know how to code the login so as it remembers the password/username of the members. The other thing is I want the completed regestration form to be emailed to me (or sent to me in some way) so as I can say whether or not I want that person to be a member, before the person is permitted access to the 'members only' area.
View Replies !
Browser Based Ftp Login
What I want to do is have an HTML page where users type in a username and password. After they click submit they are redirected to "ftp://username:password@domain.com" where they can download and upload files to their folder. Each username will have a folder in the directory that has the same name as the username. `So if "Mark" logs in, I want him to see the contents of the "Mark" folder where he can upload and download files. I don't want him to have access to anything else. As I know nothing, I did a lot of reading up and researching on how to do this (lots of great information on this site by the way) but the PHP code might still be way off. Here is the code I have so far: for the html login page: <html> <body> <form name="form" method="post" action="ftp.php"> Username: <input name="username" type="text" size="30"> Password: <input name="password" type="password" size="30"> <input type="Submit" size="8" value="Submit"></p> </form> </body> </html> the code for the ftp.php page is : <?php $ftp_server = 'domain.com'; //domain being the future website domain $ftp_username =$_POST['username']; $ftp_password =$_POST['password']; $location = 'ftp://$ftp_username:$ftp_password@$ftp_server'; header('Location: $location'); $ftp_connect_id = ftp_connect($ftp_server); $ftp_login = ftp_login($ftp_connect_id, $ftp_username, $ftp_password); if (! $ftp_connect_id || ! $ftp_login) { echo "Unable to connect to ".$ftp_server; exit; } else { echo "Connected to host "<p>"; } ftp_close($ftp_connect_id); ?> right now, when i check it, I log on the html page and go the the php page where all it says is "Connected to host." I don't see the "ftp://username:password@domain.com" that I want to see.
View Replies !
Linux System Users Login/Password?
Has anyone managed to code anything that will verify the username and password of a user against the /etc/shadow file? I need to authenticate users based on their local system accounts, but unfortunately need to do this without recompiling PHP or Apache with custom modules. So far I've managed to pull all of the shadow password strings out and into a database, but is there any way of 'matching' the encrypted strings if you are given the plain text version, like with md5?
View Replies !
Set The HTTPS Username And Password Using Php/flash And Then Open The Secure Page.
My hosts allow secure https logins on specific directories. What I want to do is have a login screen in flash, if the user enters the correct username and password I would like to set the HTTPS username and password using php/flash and then open the secure page. In my mind at this point they'll be logged in and then can navigate the secure page without seeing the browsers https login dialog. Am I kidding myself, or is this possible? They're config is the following: PHP Version 4.3.11 4.9-STABLE FreeBSD Zend Engine v1.3.0 Apache/1.3.33 (Unix) PHP/4.3.11 mod_ssl/2.8.22 OpenSSL/0.9.7c FrontPage/5.0.2.2635 mod_throttle/3.1.2
View Replies !
Query The Database At The Beginning Of Every Page And Make Sure The Password Matches The Username?
I've got a login page that accepts a username and password. The action script for the form on the login page encrypts the password and then queries a database to see if the username and password jive. If they do, the user is "logged in"; that is, a session is started (I'm using php 4) and the variables "username" and "password" are registered along with some other vars. In subsequent pages that require authentication, I include a file that looks like this: if( !($PHPSESSID && $username && $password) ) { // User has not been logged in...go to login page header("Location: ${basename}login.php"); exit;} Is that enough? Or do I need to query the database at the beginning of every page and make sure the password matches the username? I didn't do that to begin with because of the overhead involved.
View Replies !
Authentication Script - Login Script That Accepts A Username And Password
I have created a small authentication script. I have a login script that accepts a username and password, which is then passed to do_authuser.phh to check to see if the username and password are present in the database. If it is it forwards you to admin section. Now the script is working fine, but what code do i put in the admin_menu.php section so that it also checks the database. Right now I can type admin_menu.php in my browser and it shows. Which is no good, I know that some of the code that I have in my do_authuser.php has to be there, so that it checks the database. But i'm not sure what. PHP Code:
View Replies !
Login Problem - Username + Password Are "Invalid".
My friend is having me do work on a php script he uses to manage data for his work on an intranet. This script he sent requires a login. I uploaded the script to a server that is MySQL compatible. I used the data dump he sent to fill in the tables in "phpMyAdmin". When trying to access any of the pages on my browser I am defaulted to the login page. I have the list of users and their usernames and passwords. My friend even gave me his username and password, but nothing works. It's telling me that my username + password are "Invalid". Anyone know what's going on?
View Replies !
REdirect Users Based On Their Access Level To The Appropriate Page.
I'm trying to direct users based on their access level to the appropriate page. If admin_access = 1; these users should go to welcome.php. If admin_access = 2; these users should go to index.html. When I test the accounts with the levels, the users all go to welcome.php. Can someone help me out in redirecting the users to the proper location? Code:
View Replies !
Set A Cookie For A Login Page To Get The Browser
How do you set a cookie for a login page to get the browser to remember the login info. Also, I read that : header("cache-control: private") or something close causes IE to maintain form post data in case an input error is made and the user needs to go back to the form. Is this accurate?
View Replies !
WWW-Authenticate: How To Force Password Login At Every Page Refresh ?
<!-- The following sample should authorize the user to log on the site. This works once but after refreshing the browser, it does not prompt again for login until all browser (IE 6) windows are closed and the same page is opened. I turned off all caching but still it does cache (as a refresh doen not promt again). How can I force the page to prompt for a password at every refresh --> <html> <head> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <?php $showall = false; error_reporting (E_ERROR); if (($PHP_AUTH_USER != "myname") || ($PHP_AUTH_PW != "mypass")) { header('WWW-Authenticate: Basic realm="Secure Login"'); header('HTTP/1.0 401 Unauthorized'); $showall = false; } else { error_reporting (E_ALL ^ E_NOTICE); $showall = true; } if (!showall) { echo "access denied"; } else { ?> ................ </head> <body> ................. <? } ?> </body> </html>
View Replies !
PHP Page That Displays Html Based On The Address Enterd
I would like to have a PHP page that displays html based on the address enterd. For example: index.php?example=a would show a page with <body>Example1234</body> whereas index.php?example=b would show a page with <body>Example5678</body>. I've done this before, but I can't remember the code I used.
View Replies !
Browser Emulator Print Html Web Page To PDF
We need to have PHP print a Web page, from another server, to PDF. What we don't need is for PHP to read the code of the Web page and print the code to PDF - we need PHP to actually print exactly what the Web user sees in their browser, just as if a Web user had navigated to the page and had their browser print the page. I've extensively searched for a script to do this - I believe it will have to be written but don't really know where to start. It seems like the code would have to be some kind of Mozilla emulator. Any suggestions for other solutions would be appreciated too - perhaps a non-PHP, client-side script that actually opens Mozilla, gives it the URL, then engages the print function.
View Replies !
Password Protected Directories For Users To Be Able To Edit There Password
Do use all know password protected directories are, the directories that you set and apply users to through c-panel (if you have used c-panel). i want to use that way of password protecting areas of my site, but i want users to be able to edit there password. Is there a way that php can talk to the server to tell (it may be apache) to change the password to what the user specifies. I hope use know what i talking about, here's a screenshot of what i mean http://files.siliconjunkie.com.au/files/password.jpg
View Replies !
Session Based Login Script Re Login Problem
I have built this login script, it logs u in and shows the first page... i have built it to be require()'ed, when i have required it from a browser script i made it loads the front page, then when i ask for browser.php?edit=file.html It then asks me to re login and takes me back to the front page! PHP Code:
View Replies !
Type Original Password Then New Password
Im working on a change password.php. I want the user to have to type in there original password then there new password, followed by the confirmed new password. I have pretty much written the code to do this however the password which is stored in the database is encryped using PASSWORD ('$password') at registration. This means that when I attempt to match the password in the database with the current password they do not match. How can I do this? I assume it must be something to do with how the current password is retrieved from the database so here is my code to retrieve the password from the database: Code:
View Replies !
Username And Password
I've got this 'helpdesk' application where people can simply fill out a form and send it off. Each time they have to type in their name, phone number and email address- then answer the questions that they're having problems with. I'd rather store that common non-variable info in a database and pull it out so that they don't have to type it in each time. Is this possible without issuing each individual their own username/password? Or would it be best to have each person log in one time and create their own accounts? Before I just had 3 or 4 general usernames/passwords that the organization members used. I'm trying to keep confusion down to a minimum here. Would it be feasible to have them log in with their last name and pull the information based on that- or there must be another way.
View Replies !
Set FTP Username And Password
My current scenario for this process is a follows: I create a new user and set up the directories with a script. One of the directories is for uploading files and I create an FTP username and password manually in my isp’s control panel. This locks down the directory when the user logins with an FTP client. I have been told that I should be able to set the FTP username and password from the script but despite lots of searching cannot find the answer.
View Replies !
Username, Password, And Hotmail?
I have a script that collects a username and password which doesn't seem to work if the user is a hotmail/msn frame. When they get a message on the system a notification is sent to them with a link to the site, and again, that link doesn't work as it should - unfortunately a lot of the users use hotmail. What's the problem? What do I need to do?
View Replies !
How Can I Get IMAP Username And Password?
the IMAP functions has been compiled into PHP on my server, and then each time access my page index.php from a web browser, I was asked enter username and password, is there any nice person tell me, how can I get IMAP username and password?
View Replies !
Setup Username And Password
Normaly only Administrator can setup username and password for new users. However, could you please tell me how a visitor can regist himselve a new username and password so that he can post new messages. So he only can read messages but if he wants to post new message, he has to input his username and his password. (For example, visitor can read message in this forum but if he want to post message he have to regist for an username and password) then he can post). How I can set up like that. I thought that cookies does not work in this case.
View Replies !
Session_register - Username And Password
I have this forum that I'm creating, and users login to. Ok, the user enters their username and password. If they get them wrong, an error message is displayed. Otherwise, this is what I want to do. I take this variable, $forum_sess. PHP Code:
View Replies !
Emailing Username And Password
I want to be able to look up a person username and password so that I can send there information to them by email. the code does get the email address and looks it up but the problem is getting the username and password to be retrived and to be displayed. The email is sent properly but for the username i get "Resource id #2" and password I get "Resource id #4" as output. The txtemail is sent by a form. PHP Code:
View Replies !
Set The FTP Username And Password From The Script
I create a new user and set up the directories with a script. One of the directories is for uploading files and I create an FTP username and password manually in my isp’s control panel. This locks down the directory when the user logins with an FTP client. I have been told that I should be able to set the FTP username and password from the script but despite lots of searching cannot find the answer.
View Replies !
Embeding Username And Password?
I have a live audio feed that I listen to off my friends website that is password and username protected. He gave me the user/pass and I asked him if I could post the link on my website so I can let others listen to the stream as well. He said that since its user/pass protected I would have to come up with a way to automatically username and password when the stream is started and he said if I can get it to work then he will let me use it. I asked if he can just remove the user/pass but he said there are other people who abuse the stream and thus he wont remove it. So my question is, is there a way I can embed this live audio feed along with the username and password in a PHP script so when people go to listen they are not promoted for a user and pass?? I really have no idea where to start with this thus Im asking on here!
View Replies !
Verify Username And Password
How do I use php script to check whether a persons username and password match thoes in a table. I have a table with all the details of users and a form which allows a user to type in their username and password. On the action of onsubmit how could i use php to check from the table that this name exists?
View Replies !
Mirroring Username And Password
I was wondering if someone could give me some guidance in mirroring 2 databases with their username and password. I have 2 databases that I would like to mirror with the username and password. Do i setup a script? cronjob?
View Replies !
Cannot Use Or Change Username Or Password
I bought a website written in PHP which uses mySQL. The site works fine, but the problem I am having is that I cannot access the admin area because the username and password do not work. The company I bought the site from has been trying to fix the problem for 3 days, but to no avail. I was wondering if any of you have an idea as to what the problem might be. They have tried to reset it, make a new one etc etc etc, but nothing works. Here's the code for the admin login.php file Code:
View Replies !
Username & Password Generator
can anyone help me with the coding of username & password? basically, I need to extract the first 2 letters of 3 strings passed and set it as username, then generate a random 4 digit password with PHP, I've tried that in java, but ot sure how to do that in PHP?
View Replies !
Username/password Verification
I´m trying to do a username/password verification, but it´s not working, even when the user/pass is correct, it will ask for the pass three times and then deny me the acces to the page, does somebody know what i´m doing wrong the passwords.txt has the following format: username|password and here´s the code:
View Replies !
Stroring Username And Password
How do i store database username and password outside the document root? I have found some info on doing this, but it explains that i should store the info within httpd.conf folder, but i dont seem to have access. Thanks i advance for any help, advice and suggestions given. Project completion date is this week, so extra,
View Replies !
Username + Password Check
Okay so I have a registered name and password - a hashed one - stored in the database table called member. First, when someone submit the form for a login, how do I match the name the person typed with the name in the database, case-insensitive and how to I check whether the 2 passwords match since one is hashed, which is the one in the database. BTW, for the forms, I'm using $_SESSION to store the $_POST values.
View Replies !
Deleting Username When Browser Is Closed.
Hi i am trying to delete a user from the online users when they close the browser, this is how i have done it: <?php if(@$_SESSION['Loggedin'] == 'false'){$result = mysql_query("DELETE FROM online_users WHERE loginname='".$_SESSION['loginname']."'") or die(mysql_error()); $row = mysql_fetch_array( $result ) }?> But im getting this error: Parse error: syntax error, unexpected '}' when users login it inserts there username into the online users, and when they logout it deletes it, but i am having trouble when the user doesnt logout and just closes the browser.
View Replies !
Hiding Login & Password Fields After Login
I am hoping to do the following, the homepage shows a username and password field. Once the user enters a scucessfull login, these fields are removed. In order to achieve this, must the page be based on one big IF ELSE statement? so... If user logged in hide username & password fields Else show page with username and password fields? OR is this acheived by redirecting the user to a page that is not the homepage after a successfull login? so... the user would login sucessfully and be redirected to a homepage identical to the one with the fields but will have the username & password fields removed?
View Replies !
Script For Username & Password Verification
i have this code here to see if the users that come to my site and logon have the correct username & password. they are stored in the file ../extensions/l&p.txt (loginsandpasswords.txt). can it be simplified from what it is now? PHP Code:
View Replies !
I've Deleted Admin Username And Password,
I've deleted my admin username and password which was initially set at test. Now I can't log into my website as the administrator. How do I put Username and Password back so that I can set my own password and username again, log in to my website and edit it. Which file do I have to edit, and where do I re-set the Username and Password?
View Replies !
Securing Host Username Password
i am going through the process of password protecting a directory using ..htaccess and .htpasswd i am experiencing difficulty. so my question is without making life anymore difficult is if the webhost already has a password protected directory option is this secure enough? i dont need password protection at the directory level and at the file level do i? i want to protect the php_include files that will contain my $host $username $password. here is what i did only so you dont think i am totaly crazy. AuthUserFile /home/file_access/.htpasswd AuthName EnterPassword AuthType Basic require usernamegoeshere i put .htaccess in a directory like publichtmlfolder/php_include i put usernamegoeshere : encryptedstringgoeshere i must be missing some little step. i uploaded ascii. i just dont know. i am at a loss. note: it isnt even displaying the EnterPassword in the password dialog. It seems to be the password directory dialog for logging on to ipowerweb. The only thing i can say looks even partially right is when i type in mydomainname/php_include i am prompted with the password dialog.
View Replies !
|