Redirect to URL with input value filled

Asked

Viewed 310 times

1

I wonder if it is possible to mount a redirect to a third party login screen with the input "value" filled?

would point out something like: http://dominio.com.br/login?pt01=admin-51

the input is like this:

<input id="P101-USERNAME" name="pt01" value="" placeholder="Usuário" type="text">

It is possible to mount a url that fills the value field?

  • you want the value of the p_t01 url to fill the value input pt01? that?

  • That’s right Diego

1 answer

1


If I understand what you want, take the value passed in the url GET after a simple check adds the value to the value of input:

$p_t01 = filter_input(INPUT_GET, 'pt01'); //pegando o valor
$input = '';
if(!empty($p_t01)){
    echo "<input input id='P101-USERNAME' name='pt01' value='$p_t01' placeholder='Usuário' type='text' />";//adicionando o valor ao input
}
echo $input;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.