codeigniter uri segment url appending at the end

url : http://localhost/back-office/index.php/staff/shopping

when i change the category on every onchange event i want the url should be like this


for that i wrote javascript on change event

function cat()
    var x = document.getElementById('cat').value;   
    document.location = "shopping/" + x;


     <select name="cate" id="cat" onchange="cat()">
        <option value="0">Select Cateogry</option>
        foreach($get_cat as $category)
            echo "<option value=$category->categoryid>$category->category</option>";            

the javscript works , but the url getting appended like



on every cagetory drop box onchange event the url is getting appended like this at the end.

how could i solve this


you need to specifically code your url..try this

function cat()
    var x = document.getElementById('cat').value;   
    url  = "http://localhost/back-office/index.php/staff/shopping/" + x;
    window.location = url;


Need Your Help

Order by, group by, first result in HQL (convert from Oracle SQL)

java oracle hibernate hql sql-order-by

How would represent the following Oracle SQL in Hibernate HQL.