You can use jquery
to do this, I did run but I believe it will work:
You put this script in your index.php
or create a .js file (do not forget to remove the <script>
and </script>
tag for it) and reference its index
also works.
<script>
$(document).ready(function () {
$("#botao").click(function () {
var pegalink = document.getElementById('link').value;
window.open("teste2.php/" + pegalink);
});
});
</script>
And add this to your index.php
:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><inputtype="text" name="link" id="link">
<input type="button" id="botao" name="botao">
And then just change the link from window.open
to the page that wants to assign the values in the URL ( enviado.php
, for example) and my values that are in the fields of the script and the inputs by their that works normal .