code:
$(document).ready(function(){
$(".uni_type").click(function(){
uni_type = this.id;
location.href = "filter-colleges.php?uni_type="+uni_type;
});
});
html code:
<ul>
<li class="uni_type" id="central university">Central University</li>
<li class="uni_type" id="state university">State University</li>
<li class="uni_type" id="private university">Private University</li>
<li class="uni_type" id="deemed university">Deemed University</li>
<li class="uni_type" id="open university">Open University</li>
<li class="uni_type" id="autonomus">Autonomus Institute</li>
</ul>
filter-college.php
<?php
include('conn.php');
$uni_type = $_GET['id'];
echo '<script>alert('.$uni_type.')</script>';
?>
In this code I want to get uni_type value from the URL but when I click on any list item I'm moved to next page (i.e filter-colleges.php) and given an alert to $uni_type on filter-colleges.php page, but no value is displayed in the alert box. How can I get value from URL or alert $uni_type?