if (! empty ($ _ POST)) nie działa

Mam formularz php (kod do naśladowania) z przyciskiem przesyłania, który działaJSON-events.php jak jegoaction (method = POST). W kodzie zdarzeń JSON sprawdzam, czy formularz został przesłany przy użyciuif (!empty($_POST)). Moim problemem jest to, że kod zdarzeń JSON wydaje się nie rozpoznawać$_POST.

Oto sekcja kodu po stronie formularza.

<div class="simple_overlay" id="searchform">
<form id="myform" class = "cols" action="json-events.php" method="post" >

    <h3>Search</h3>

    <p>
      <label>address/postcode *</label>
      <input type="address" id="searchaddress" />
    </p>
    <p>
    <label for="amount">maximum distance:</label>
    <input type="text" id="amount" value="5 miles" style=" border:0; color:#43a8c4; font-weight:bold;" />
    </p>

    <div id="slider-range-min" style="width:130px; margin-left:4px; margin-bottom:20px"></div>

    <p id="terms">
      <label>Category 1</label>
      <input name="cat1" type="checkbox" value="1" checked="checked"/>
    </p>
    <p id="terms">
      <label>Category 2</label>
      <input name="cat2" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 3</label>
      <input name="cat3" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 4</label>
      <input name="cat4" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 5</label>
      <input  name="cat5" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 6</label>
      <input name="cat6" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 7</label>
      <input name="cat7" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 8</label>
      <input  name="cat8" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 9</label>
      <input name="cat9" type="checkbox" value="1" checked="checked"/>
    </p>
      <p id="terms">
      <label>Category 10</label>
      <input name="cat10" type="checkbox" value="1" checked="checked"/>
    </p>
    <p>
      <input type="hidden" name="searchlat" id="searchlat"/>
    </p>
    <p>
      <input type="hidden" name="searchlong" id="searchlong" />
    </p>

    <input type="submit" name="search" id="search"/>
    <input type="button" value="Check Address" onclick="codeAddressSearch()"/>
    <button type="reset">Reset</button>

</form>
</div>

a tu jest górna część JSON ...

if (!empty($_POST)) {

wszelka pomoc bardzo doceniana

questionAnswers(6)

yourAnswerToTheQuestion