ftp quick login

K

Kim

Hi all,
Im trying to make a quick login on my html webpage to ftp serv, but im stuck!
This is what i use (trying to make it simple), and nothing happens.

---
<form method=GET action="ftp://" + username + ":" + password + "@" + localhost:8080">
Username:
<input type="text" name="username">
Password:
<input type="password" name="password">
<input type=submit value="Login">
</form>
 
H

Hywel

Hi all,
Im trying to make a quick login on my html webpage to ftp serv, but im stuck!
This is what i use (trying to make it simple), and nothing happens.

---
<form method=GET action="ftp://" + username + ":" + password + "@" + localhost:8080">
Username:
<input type="text" name="username">
Password:
<input type="password" name="password">
<input type=submit value="Login">
</form>

Is FTP really running on port 8080? Hasn't IE been patched to prevent
what you're trying to do? It has for HTTP.
 
K

Kim

Hywel said:
Is FTP really running on port 8080? Hasn't IE been patched to prevent
what you're trying to do? It has for HTTP.
Hywel

That's up to me, i can run http server on port 21 and ftp server on port 80 if i like.
Reg Kim
 
T

Toby Inkster

Kim said:
<form method=GET action="ftp://" + username + ":" + password + "@" + localhost:8080">

You can't just make stuff up and expect it to work!

The form:
=====================================================
<form method="post" action="ftplogin.php">
<fieldset>
<legend>Log in</legend>
Username: <input name="username">
Password: <input name="password">
<input type=submit value="Login">
</fieldset>
</form>
=====================================================

And in ftplogin.php:
=====================================================
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: ftp://'
. $_POST['username']
. ':'
. $_POST['password']
. '@ftp.example.com:21/');
?>
<title>301 Moved Permanently</title>
<p><a href="<?= ('ftp://' . $_POST['username'] . ':' . $_POST['password']
.. '@ftp.example.com:21/')?>">Location</a>.</p>
=====================================================

I can't promise that that will work universally, but I've given it a quick
test in Opera 7.5 for Linux and it works here.
 
K

Kim

Thanks, i'll try that, im just not into php, have to find out how Apache eat php scripts
Reg, Kim

Toby Inkster said:
Kim said:
<form method=GET action="ftp://" + username + ":" + password + "@" + localhost:8080">

You can't just make stuff up and expect it to work!

The form:
=====================================================
<form method="post" action="ftplogin.php">
<fieldset>
<legend>Log in</legend>
Username: <input name="username">
Password: <input name="password">
<input type=submit value="Login">
</fieldset>
</form>
=====================================================

And in ftplogin.php:
=====================================================
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: ftp://'
. $_POST['username']
. ':'
. $_POST['password']
. '@ftp.example.com:21/');
?>
<title>301 Moved Permanently</title>
<p><a href="<?= ('ftp://' . $_POST['username'] . ':' . $_POST['password']
. '@ftp.example.com:21/')?>">Location</a>.</p>
=====================================================

I can't promise that that will work universally, but I've given it a quick
test in Opera 7.5 for Linux and it works here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top