Hi,
I am trying to make a loginscript…
I managed to do a script that got the username + password from the form and redirected the browser to “ftp://$user
pass.thewebsite.com/”
But I thought this was a bit unsecure, as it came up in the browser…
So I came up with this:
<?php
// variables :P
$ftp_server = "ftp.website.com";
$ftp_user = $_POST['Box1'];
$ftp_pass = $_POST['Box2'];
// set up a connection
$conn_id = ftp_connect($ftp_server) or die("$ftp_server connection FAILED");
// create session
$login_result = ftp_login ($conn_id, $ftp_user, $ftp_pass);
// check session
if ((!$conn_id) || (!$login_result)) {
echo "FAILED As: $ftp_user / $ftp_pass"; die;
} else {
echo "Connected As: $ftp_user / $ftp_pass";
}
?>
This works and will authenticate the users name and password fine, but it will just stay on this page… Is there anyway of once authenticating taking you to their part of the ftp on the website?
(ive tried a redirec to ftp://$user@thewebsite.com/, but then that just says then need to login again).
Any comments or sugestions are welcome,
thanks.