I have WordPress site and custom table in DB. I need an user can enter promocode in the form, submit it, script find URL in the table by this promocode and open this URL in new window. I insert this HTML in widjet
<form method="get" id="searchform" action="">
<input type="text" name="destination" id="destination" value="" />
<input type="submit" id="searchsubmit" value="GO" />
</form>
And insert this code in function.php
$q = $_GET["destination"];
$result = $wpdb->get_results( "SELECT url FROM mytable WHERE target = ".$q);
var_dump($result);
But how to open window?