Question

I have a php website, where in the header i am displaying the facebook image which is pointing to my facebook page.

Now I have multiple fb pages so I want to display a drop down, in which all the fb pages are listed and when the user select a page from the drop down, he/she will be redirected to that fb page?

Is it possible? if yes then how will I do this?

Was it helpful?

Solution

Just have a select list in your HTML code, with the value of the options set to the page id/name, or even the full URL.

Then you either react to a change in the dropdown via JavaScript (onchange event) and redirect per location.href="address", or you put it inside a form element and send it to your server and redirect from there (location header) with the submitted option value.

That’s pretty basic stuff – anyone with a little knowledge in web development should be able to do that on their own. If this still sounds complicated to you, please get some basic understanding of the techniques involved first.

And if you don’t like the basic select element style, you can always fancy it up via some jQuery or whatever plugin, there are lots of them out there that help you restyle a simple select element to your layout/design needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top