I must have a problem somewhere with formatting my code but cant find where, This is the form I place the search bar in:
<form>
<?php include_once("searchbar.php"); ?>
</form>
This is my search bar code:
<form method= "post" action = "search.php">
<input type="text" name="search_input" placeholder="Search Designer Sofas..." />
<input type="submit" value="Search" />
</form>
And this is the beginning of the search results page
<!DOCTYPE html>
<?php
//retrieves the specified element from the URL
$search_input = $_POST["search_input"];
include_once("connection_to_db.php");
//isset function checks if a variable is set
if(!isset($search_input))
{
print("Nothing to search !");
return;
}
//take the books with the specific name
$query_products = "SELECT * FROM XXX WHERE name LIKE '%".$search_input."%'";
$query_product_result = mysql_query($query_products)
or die(mysql_error());
$num_rows_products = mysql_num_rows($query_product_result);
?>
<html lang="en">
<head>
Now what happens is that when I click on the search button the address changes in the url to the search query but the page doesnt, does it mean that it is sending to it but not receiving anything?