搜索表单以向外部站点提交查询

I would like to be able to type a search phrase into an input box, click send, and have a tab open to a new site where the address is something like http://externalsite.com/?q=SEARCH_PHRASE.

Is there a way to provide this functionality using PHP? I'm trying to avoid using javascript.

Don't even need PHP, just standard HTML.

<form method=get action="http://externalsite.com" target="_blank">
<input type=text name=q value="">
<input type=submit value="lets go">
</form>
<form  action="http://www.externalsite.com" target="_blank">
<input type=text name=q value="">
<input type=submit value="lets go">
</form>