I have a CakePHP search form with 'type'=>'get'. Basically, one of the elements in the form is a button to send an image of a type. When the form is posted, in the URL I always get these x and y coordinates of the submit button:
'type'=>'get'
http://site.com/controller/action ? x = 22 & y = 36 & query = hello
Is there a way to prevent the display of coordinates in the url? The reason is because someone else could use the same URL to perform the same search, without this unintuitive material in the link.
Thank!
javascript :
document.getElementById('myImageButton').onclick = function() { this.form.submit(); return false; };
, beforeFilter , URL. , 2 HTTP-.
beforeFilter
, Post/Redirect/Get.
CakePHP:
POST GET:
POST
GET
/search?q=contact
/search/contact
submit button .
submit
button
echo $this->Form->**button**($this->Html->image('header_search_icon.png'), array(**'type'=>'submit'**));
Source: https://habr.com/ru/post/1726395/More articles:consume yahoo webservice from .net code - c #Does PayPal include payment integration options that do not require PayPal to be displayed to the user? - paypalHow to enable multiple jars in classpath using ant? - javaЛучший способ выбрать из списка - не два списка, которые немного стареют? - css-selectorsWhat is best used for private methods? - c #How can I use wildcard search to get a list from the forest in CakePHP? - phpWhat is the most suitable type of cfsqltype Coldfusion to use in a field like a unique MS SQL identifier? - coldfusionHow can I programmatically get a loaded project in Visual Studio 2008? - c #What does "Django Application Migration" mean? - databaseHow to pause the background thread, and then continue at the click of a button? - c #All Articles