I'm hoping this is easier than what I've made it out to be so far. I would like to pass a variable from an href tag as my SQL 'SELECT WHERE' qualification. I think I'm on the right track, but can't figure out how to get PHP to pick up the variable.
This is contained within the href tag and calls the JavaScript below:
onClick="queryPanel('450','300','php/weblinks1_select.php3','Auction'); return true;"
This is the JavaScript that is called:
var querypanel = null;
function queryPanel(width,height,url,query) {
var query_width = width;
var query_height = height;
var query_top = (screen.height-query_height)/2;
var query_left = (screen.width-query_width)/2;
querypanel = this.form.post.submit('+ query +');
querypanel = window.open(''+ url + '','display','scrollbars=yes,resizable=no,menubar=no,width=' + query_width + ',height=' + query_height + ',top=' + query_top + ',left=' + query_left + '');
querypanel.focus();
}
The "querypanel = this.form.post.submit('+ query +');" was my latest stab in the dark.
And finally, this is the mySQL select statement:
$query_string = "select type,url,note,submitter from weblinks1 where type=$query";
Am I going about this all wrong, or is there something obvious that I'm missing?
Thanks, Adam.