currently my url is something like this..
example.com/index.php?item1=BLUE%20BOX&item2=WHITEBOX&item3=ORANGE%20BOX&ITEM4=REDBOX
what i want to make it like ..
example.com/index.php/BLUE-BOX/WHITEBOX/ORANGE-BOX/REDBOX
javascript i am using is..
in php i am using dynamic chain dropdown list the dropdown data is being populated from the database.i am using 4 dropdown box each of them is dependend on another.on every dropdown item select i am using -onchange=\"reload(this.form)
is there any way to achieve this through javascript..as the self.location is responsible for changing the url i guess..
i also tried with mod_rewrite but its not working in localhost..
any solution for this would be highly appreciated.. please help asap
example.com/index.php?item1=BLUE%20BOX&item2=WHITEBOX&item3=ORANGE%20BOX&ITEM4=REDBOX
what i want to make it like ..
example.com/index.php/BLUE-BOX/WHITEBOX/ORANGE-BOX/REDBOX
javascript i am using is..
Code:
function reload(form)
{
var val=form.item1.options[form.item1.options.selectedIndex].value;
self.location='index.php?item1=' + val ;
}
function reload3(form)
{
var val=form.item1.options[form.item1.options.selectedIndex].value;
var val2=form.item2.options[form.item2.options.selectedIndex].value;
self.location='index.php?item1=' + val + '&item2=' + val2 ;
}
function reload4(form)
{
var val=form.item1.options[form.item1.options.selectedIndex].value;
var val2=form.item2.options[form.item2.options.selectedIndex].value;
var val3=form.item3.options[form.item3.options.selectedIndex].value;
self.location='index.php?item1=' + val + '&item2=' + val2 + '&item3=' + val3 ;
}
function reload5(form)
{
var val=form.item1.options[form.item1.options.selectedIndex].value;
var val2=form.item2.options[form.item2.options.selectedIndex].value;
var val3=form.item3.options[form.item3.options.selectedIndex].value;
var val4=form.item4.options[form.item4.options.selectedIndex].value;
self.location='index.php?item1=' + val + '&item2=' + val2 + '&item3=' + val3 + '&item4=' + val4 ;
}
is there any way to achieve this through javascript..as the self.location is responsible for changing the url i guess..
i also tried with mod_rewrite but its not working in localhost..
any solution for this would be highly appreciated.. please help asap