будет более понятно, если вы не будете использовать php в html для этой проблемы, используйте javascript
, вы можете попробовать отправить форму по ajax, jquery примеру:
$("#dreptunghi").submit(function (e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
var form = $(this);
var url = form.attr('action');
$.ajax({
type: "POST",
url: url,
data: form.serialize(), // serializes the form's elements.
success: function (data) {
alert(data); // show response from the php script.
}
});
});