How to pass HTML form element parameters directly to the URL

Asked

Viewed 35 times

1

I need to pass information directly to the browser but the result of the code is always returned as https://xxx.com/? cli=value need to return in the URL only the value contained in the input without the characters "? cli="

in that way https://xxx.com/value

Follow the current code:

<form method="GET" action="https://xxx.com/"&cli>

Cliente: <input type="text" name="cli" placeholder="Digite seu código">

<input type="submit" value="Acessar">

</form>
  • 1

    Will need to use javascript...

1 answer

0

In this case you will work with Friendly URL.

For this it will be necessary to change your

.htaccess

:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?url=$1
</IfModule>

Then just manipulate your URL as you wish...

https://xxx.com/value

<?php

  echo $_GET['url'];

 ?>
  • Only has a "small detail" the basis of this my code is hosted on a wordpress platform already with some changes, so everything has to be accomplished within the pages I’m working basically if I add to Rewriterule (.*)$ index.php? url=$1 will take the entire site off the air, or at least some parts of it

Browser other questions tagged

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