Explore how simple forms can hijack real search engines
This is a simple HTML page built without a backend or fancy frameworks. It may look plain, but that's the point—the goal is to demonstrate how search forms work by leveraging the URL query structure of popular websites.
You can use this same approach to search Google, YouTube, Reddit, or nearly any site—as long as you know which query parameter the server expects. Reddit uses q
, YouTube uses search_query
, and others have their own. By inspecting the URL after a search, you can learn how to mimic that behavior with your own forms. Later on, this same pattern can be used to send data to your own backend.
This demo uses basic HTML forms to send search queries directly to third-party websites. Each form has an action
attribute set to the URL of a search engine (like Reddit, Google, or YouTube) and an input
field named after the query parameter that site expects.
For example, Reddit uses ?q=
, Google uses ?q=
, and YouTube uses ?search_query=
. When you enter a term and hit "Search," your browser sends that query to the correct site, and the results page opens in a new tab. That's it—simple, but effective!
I wasn't planning to code at all today. I opened my browser and headed to Udemy with the simple goal of watching just one video for The Web Developer Bootcamp I was on the section about forms, and the video was titled "Hijacking Google and Reddit's Search" by Colt Steele.
The idea of using a basic form to trigger a search on Reddit or Google sounded cool, so I decided to follow along and build a quick test page. One thing led to another, and before I knew it, I had spent an hour coding—and ended up with a working demo where you can search Reddit, Google, and YouTube all from one page.
This project started with zero motivation and turned into something real. The moral of the story? Just start. Even on the days you don't feel like coding, doing one small thing can lead to progress—and maybe even a finished project you're proud of.