Hey Guys, What’s up?
Today I’m serving you with few PHP tutorials regarding “Creating a Search Engine in PHP“, it is however, a very basic PHP & MySQL tutorial series to know the basic idea for creating a search engine in PHP. For advance tutorials, you may connect with me using this blog, so I can update you in the future.
This tutorial is aiming to teach you “Creating a very basic search engine in PHP” which can display the relevant results on the browser upon the users’ query in the search box. We’ll use PHP $_GET method to receive the input from the users and then we’ll display the results using a MySQL Query. There are many filters, we’ve set while creating this simple PHP tutorial, and You’ll learn all the steps live by watching my video tutorials on this page.
Before You learn this project, kindly have a look at my other PHP projects as well:
- eCommerce Website in PHP
- Advance CMS & Website in PHP
- Paypal Payment Integration in PHP
- Creating a registration form & admin panel in PHP
- Complete CMS & website in PHP & MySQL
- PHP video tutorials for beginners
What we’ll learn by watching this series?
- Creating an HTML form for providing search option to the users
- Creating a database to insert some dummy data
- To display the relevant results upon users’ request
Let’s start! what you’ll need to create a search engine?
- First of all kindly open your favorite text editor i.e Notepad++ or DW etc
- Create a file called “search.php“
- Now go to “PHPmyAdmin” located at “XAMPP” your localhost
- Create a database called “my_db” or name it anything you’d like
- Create a table “sites” & add 5 columns for i.e Keywords, title, description etc
- Now just insert some dummy data into the columns
- You are ready to Go!
After doing above steps, now you can easily create your first ever search engine in PHP very easily with my video tutorials in English. Just watch the given video tutorial series below to know each and everything for creating a search engine in PHP. However, don’t forget to find the source code for this project below the videos:
Creating a search Engine in PHP video tutorial # (1)
Creating a search Engine in PHP video tutorial # (2)
Creating a search Engine in PHP video tutorial # (3)
So after watching the videos, you have clearly understood the steps to create a very simple search engine in PHP in my simple and funny English 🙂 However, you can also have the source code for this project. I want to give you everything for your own project.
The Source Code for this project
Now here is the whole source code which I used in this tutorial, just copy the below given source code and use it in your own practicing project:
<title>Search Engine in PHP</title>
</head><body><form action=”search.php” method=”get”>
Search Engine:<input type=”text” name=”value” placeholder=”Search Anything here”>
<input type=”submit” name=”search” value=”Search Now”>
$search_value = $_GET[‘value’];
$query = “select * from sites where site_keywords like ‘%$search_value%'”;
$run = mysql_query($query);
$title = $row[‘site_title’];
$link = $row[‘site_link’];
$desc = $row[‘site_desc’];
echo “<h1>$title</h1><a href=’$link’>$link</a><p>$desc</p>”;
Now let me go to sleep, because this is late night here 🙂 and have fun with PHP web development. While you can wait for my upcoming exciting tutorials in PHP & MySQL. And take few seconds to share this tutorial with all of your friends and have a sweet life.
Oh! I forgot to tell you that if you have any question then kindly comment below the post or just post some compliment for this tutorial. Thanks again.