vaurdan Posted July 10, 2006 at 11:37 AM Report #37313 Posted July 10, 2006 at 11:37 AM Eu queria saber como consigo fazer um login no Cpanel atravez dum form com os campos User e pass. para logar remotamente basta entrarmos como http://user.password@dominio.com/cpanel . eu queria que o form criase uma variavel com o user e com a pass. Thx 🙂 so sei a madneira da variavel: http://<?print $user?>: <?print $password?>@neohosting.info/cpanel http://www.neopt.org <- O meu blog xD
AriOps Posted July 10, 2006 at 12:02 PM Report #37321 Posted July 10, 2006 at 12:02 PM Não sei se percebi bem o que tu querias fazer, mas aqui vai: <html> <body> <form action="url.php" method="post"> Username: <br /> <input type="text" id="username"><br /> Password: <br /> <input type="text" id="password"> </form> </body> </html> url.php $user = $_POST['username']; $pass = $_POST['password']; header("Location: http://".$user.".".$pass."@neohosting.info/cpanel"); Não sei se funciona, ainda não experimentei, acabei de fazer... 🙂 Cumps Daniel Correia
vaurdan Posted July 10, 2006 at 12:14 PM Author Report #37325 Posted July 10, 2006 at 12:14 PM porreiro mas como ponho um botao para que ao clicar lá fassa o POST? http://www.neopt.org <- O meu blog xD
AriOps Posted July 10, 2006 at 12:17 PM Report #37327 Posted July 10, 2006 at 12:17 PM <head> <?php if ($_POST['submit']) { $user = $_POST['username']; $pass = $_POST['password']; print ("<script type=\"text/javascript\">window.location = \"http://$user.$pass@neohosting.info/cpanel\"</script>"); } ?> </head> <html> <body> <form action="form.php" method="post"> Username: <br /> <input type="text" name="username" /><br /> Password: <br /> <input type="text" name="password" /> <input type="submit" name="submit" /> </form> </body> </html> Pronto já funciona, mete tudo num file chamado form.php Cumps Daniel Correia
vaurdan Posted July 10, 2006 at 12:31 PM Author Report #37330 Posted July 10, 2006 at 12:31 PM está tudo bom mas o prob é que o gajo n reconhece a password :/ http://www.neopt.org <- O meu blog xD
aparicio Posted July 10, 2006 at 12:37 PM Report #37334 Posted July 10, 2006 at 12:37 PM vê se responde à tua pergunta... http://www.portugal-a-programar.pt/index.php?showtopic=3375
kingless Posted July 11, 2006 at 01:22 AM Report #37451 Posted July 11, 2006 at 01:22 AM está tudo bom mas o prob é que o gajo n reconhece a password :/ O problema está aqui: http://$user.$pass@neohosting.info/cpanel Tem que ser http://$user:$pass@neohosting.info/cpanel ou não ? o_O
vaurdan Posted July 11, 2006 at 09:24 AM Author Report #37465 Posted July 11, 2006 at 09:24 AM é sim senhora mas eu reparei nisso antes e nao deu á mesma :/ http://www.neopt.org <- O meu blog xD
aparicio Posted July 11, 2006 at 09:58 AM Report #37477 Posted July 11, 2006 at 09:58 AM que eu saiba isso funciona apenas para o protocolo FTP e não para o http! pois os campos do ftp são sempre os mesmos enquanto que no http os campos do formulário podem variar daà teres de pré-preencher o form! http://www.portugal-a-programar.pt/index.php?showtopic=3375
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now