How to send data in the same way as when clicking on a link via html tag?

There is a field for input. After filling it in, by pressing the enter button, the data should be sent. If I use a form then the data is not sent as it should, and I cannot get the value. Since you need to go through the tag <a> , but you can not enter values ​​in it as in input .

 <form action="http://hostname/index.php"> <input type="search" name="Поиск"> </form> 
  • How do you need and how to go through the form? - Daniel Shatz
  • @Daniel Shatz It’s necessary to send the html tag a , but through the form. <a href="basic/web/index.php?r=admin_panel/access/access/index&page=1"> - gilo1212

1 answer 1

So how do you need it through GET?

 <form action="http://hostname/index.php" method="GET"> Поиск: <input type="text" name="search"> <p><input type="submit"></p> </form> 

clicking on the button will go to the link of the form http: //hostname/index.php? search = <value> (see http://htmlbook.ru/html/form )

or did you mean something else?

  • I have the address - basic/web/index.php?r=admin_panel/access/access/index&page=1 , I need to go over it + add a value to this link - &page2=2 - gilo1212
  • um, <form action = "basic / web / index.php? r = admin_panel / access / access / index & page = 1 & page2 = 2" method = "GET"> ... - Necro The Human
  • It is necessary to transfer the value from the imput - gilo1212
  • Well, in my answer, where input is named "search", its value will appear in the string as "... & search = value" - Necro The Human