Create link based on user input

0

I'm trying to create a page - which can be in any language, but needs to be stored in a single file - for a user to enter their login and from there, a link is created to proceed to a site. >

This site gets the user on your link, like this: link LOGIN & enterprise

What I was able to do was static redirect link:

    <script>
    var login = "loginname";
    </script>

    <a href="#" onclick="window.open('site.com.br/usuario=' + login + '&empresa')" target"_blank">Go to site</a>

I want to make a text box with a button next to it so that when it clicks, the user is redirected.

    
asked by anonymous 18.10.2017 / 21:07

1 answer

0

Something very simple and in javascript:

<script language="javascript">
function Login(){
var username=document.login.username.value;

if (username!="") { 
window.location="http://site.com.br?usuario="+username;
}

}

</script>

<form name=login>

<input type="text" name="username" size="9">
<input type="button" value="Entrar" onClick="Login()">

</form>
    
18.10.2017 / 22:43