I'm trying to grab a URL from a normal Google search, but I just can't think of how and what functions to use. Let's say I just want to search google for: "classical music" Bach. The search could be anything. How would I go about getting this google URL with this search? Perhaps there's a way to make this search behind the scenes where the search doesn't come up?
My main goal is to then get the URL, and open the file using the file() function.
Well, I thought about this, but this is not a smart way to go because people often put special characters into their search, such as & signs, people use google-specific codes such as "define:" and quotes, and other such things. These things can only create problems. Perhaps someone can help me with a code that can fetch the url of a search? For example, if on page A I just make a form with a text input and type something there, it'll tell me on page B the url to Google of the search terms I put on page A.