Try to add the params in your ajax call:
sid = document.getElementById("sid").value;
stid = document.getElementById("stid").value;
formdata.append("sid", sid);
formdata.append("stid", stid);
And adds an id to your input type hidden.
<input type="hidden" id="sid" name="sid" value="$rec_sStdi[std_sid]" />
<input type="hidden" id="stid" name="stid" value="$rec_sStdi[stdi_sid]" />