$_POST data on same page and output

$_POST data on same page and output

Hello when a button is clicked I want to post data to the same page and show something.
Only there is nothing showing up.

My code:

  1. $(document).ready(function(){
          $("#orderbycommonnameup").click(function(e){
            e.preventDefault();
            var url = document.location.href;
            $.post(url,{orderby: "comnasc"},function(data){
                window.location.reload();
            });
        })
  2. });

<a href="#" id="orderbycommonnameup"><img src="images/icon-arrow-up.png"></a>


and on the same page as the html I have:


  1. <?php
  2. if (isset($_POST['orderby'])) {
        echo "YEAHH JQUERY POST WOIRKS";
    }
  3. ?>


The echo is not showing :-(