I need to create a dynamic link.

My link is: <a href="javascript:void(0);" onclick="miniatures()">miniatures</a>

My js function (so far):

function miniatures() {
var selection = "miniatures";
//send js var to php var
//call header
}


How do I send the value in a js var to a php var?

How do I call a header in javascript (load a url)?