Hi Friends,
My requirement is redirect to a page based on select option
I have a html code as shown below
<select name="url">
<option Value=".....&pid=00ac92ca52dc2ad07c3d5">10</option>
<option Value=".....&pid=00ac92ca52dc2ad07c3d6">20</option>
</select>
Problem is in the php page &pid is treating as variable, to redirect to page I must need &pid=.....
How solve this problem?
Thanks,
Farooq
How to redirect to link with <select option in php?
Moderator: General Moderators
Re: How to redirect to link with <select option in php?
Code: Select all
<script type='text/javascript'>
function openurl()
{
site = document.myform.url[document.myform.url.selectedIndex].value;
if(site!="")
{
location.href = site;
}
}
</script>
<form name='myform'>
<select name="url" onchange='openurl()'>
<option Value="">Select One</option>
<option Value="http://www.rediff.com">Rediff.com</option>
<option Value="http://www.whereincity.com">Whereincity.com</option>
</select>
</form>