Your approach is wrong. You do not need <?php echo "?naujiena=".$_GET['pavadinimas']."" ?> On the action attribute .
Just change the method from POST to GET , and after clicking submit (type) button you will see the value in the URL and you can get the value of $_GET .
Edited
Then you need your form like
<form name="add" method="post" id="myForm" action="garissuero.html" onsubmit="changeActionURL()"> <input name="id" type="hidden" /> <input name="skaicius" type="hidden" /> <input name="pavadinimas" id="pavadinimas" type="text" /> <input type="submit" name="prideti" value="prideti" /> </form>
And use javascript code:
function changeActionURL() { var forma = document.getElementById('myForm'); forma.action += "?naujiena=" + document.getElementById('pavadinimas').value; }
JSFiddle: http://jsfiddle.net/mETwZ/2/
source share