ftp via a form on page html ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pascal Joseph

    #1

    ftp via a form on page html ??

    To reach their accompte ftp via a page html, I place a form for our
    customer on a page. I found this code. But it doesn't work because I
    reach the base of the server and not directly the own customer
    accompte?? I have to change something on my ftp server or on the html
    page?? Thanks. pascal joseph

    <html>
    <head>
    function Login(form) {
    var username = form.username.v alue;
    var password = form.password.v alue;

    if (username && password) {
    var ftpsite = "ftp://" + username + ":" + password + "@ftp.pcl.c h";
    window.location =ftpsite;
    }
    else {
    alert("Merci d'entrer un ID et un mot de passe.");
    }
    }
    </script>
    </head>


    <body>
    <form name="login" method="get" action="#">
    Login:<input type=text name="username" size=6>
    Mot de passe:<input type=text name="password"
    size=6>
    <input type=button value="Login!" onClick="Login( this.form)">for m>
    </body>
    </html>
  • Vincent van Beveren

    #2
    Re: ftp via a form on page html ??

    Hey Pascal,

    You can specify a directory:

    For example:

    var ftpsite = "ftp://" + username + ":" + password +
    "@ftp.pcl.c h/home/"+username;

    Vincent

    pascal Joseph wrote:
    [color=blue]
    > To reach their accompte ftp via a page html, I place a form for our
    > customer on a page. I found this code. But it doesn't work because I
    > reach the base of the server and not directly the own customer
    > accompte?? I have to change something on my ftp server or on the html
    > page?? Thanks. pascal joseph
    >
    > <html>
    > <head>
    > function Login(form) {
    > var username = form.username.v alue;
    > var password = form.password.v alue;
    >
    > if (username && password) {
    > var ftpsite = "ftp://" + username + ":" + password + "@ftp.pcl.c h";
    > window.location =ftpsite;
    > }
    > else {
    > alert("Merci d'entrer un ID et un mot de passe.");
    > }
    > }
    > </script>
    > </head>
    >
    >
    > <body>
    > <form name="login" method="get" action="#">
    > Login:<input type=text name="username" size=6>
    > Mot de passe:<input type=text name="password"
    > size=6>
    > <input type=button value="Login!" onClick="Login( this.form)">for m>
    > </body>
    > </html>[/color]

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: ftp via a form on page html ??

      pascal Joseph wrote:
      [color=blue]
      > To reach their accompte[/color]

      What is that?
      [color=blue]
      > ftp via a page html, I place a form for our customer on a page.
      > I found this code. But it doesn't work [...][/color]

      Don't use it, do that server-side. Not every customer may have or want
      client-side script support available, and you annoy those who could become
      customers but are not going to due that restriction, too.


      PointedEars

      Comment

      Working...