Submiting custom form give error 404

I found solution: IF you’re using permalinks you have to use get_permalink() function:

 <?php $searchresults = site_url('/?p=1365'); ?>

change to

<?php $searchresults = get_permalink( 1365 ); ?>