ciao a tutti, devo tradurre un file asp in php in quanto il sito poggia su server unix.
Allora io ho questo codice asp:
<%
option explicit
%>
<%
dim a1
a1 = request.querystring("a1")
if(a1 = "login")then
dim username, password
username = trim(request.form("username"))
password = trim(request.form("password"))
dim urlRedir
urlRedir = "ftp://" & username & ":" & password & "@ftp.xxx.xx"
' response.write(urlRedir)
response.redirect(urlRedir)
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="default.asp?a1=login">
<table>
<tr>
<td>Nome utente:</td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><button type="submit" />Login »</button></td>
</tr>
</table>
</form>
</body>
</html>
Usando il programmino asp2php mi è venuto fuori questo:
<?
// Option $explicit;
?>
<?
$a1=$_GET["a1"];
if (($a1=="login"))
{
$username=trim($_POST["username"]);
$password=trim($_POST["password"]);
$urlRedir="ftp://".$username.":".$password."@ftp.xxx.xx";
// response.write(urlRedir)
header("Location: ".$urlRedir);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="default.php?a1=login">
<table>
<tr>
<td>Nome utente:</td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><button type="submit" />Login »</button></td>
</tr>
</table>
</form>
</body>
</html>
ma non va, inserisco i dati ma mi rimanda alla pagina di login :-( :-(
Per caso qualcuno sa dove possa trovarsi l'errore?
Grazie mille :-)

Rispondi quotando