So I am trying to insert a search form on my website that will redirect the user with their query to Google Search.
I used to be able to do this using:
<form role="search" method="get" id="searchform" class="searchform" action="http://www.google.co.uk/search?hl=en-GB&source=hp&q=">
<div id="gform">
<label class="screen-reader-text" for="s"></label>
<input type="text" value="" name="s" id="s">
<input type="submit" class="btn fa-input" value="" style="font-family: FontAwesome;">
</div>
</form>
However, this no longer works. I'm guessing this is because Google have changed the search URL, but I am unable to replicate this effect by using Google's current URL.
Any idea how to fix this?
This snippet creates a simple google search box
Hi all it seems I have solved the problem myself
name="q"
. This is what you need to make google search work; basically this is because google expectsq
as the name