Hello,
Curious to know if someone could point me in the right direction, been struggling with this for a bit now.
I have a HTML page with a search field, I can enter a search term and hit the submit button and I am directed to my search.php page with the appropriate results. What I am looking to accomplish is having the search results from the search.php page displayed in a text area below my search field in my HTML page. I have included an image to better describe what I am looking to accomplish:
Additionally below is the source from my HTML page and search.php page:
page.html
<form name="search" action='search.php' method="post">
<input type="text" class="myinputstyle" name="search" value="search" onClick="this.value=''"/><br>
<input type="submit" value="submit" class="myinputstyle">
</form>
search.php
<?php
$search = "%" . $_POST["search"] . "%";
mysql_connect ("localhost", "game_over", "Ge7Ooc9uPiedee3oos9xoh4th");
mysql_select_db ("game_over");
$query = "SELECT * FROM game_over WHERE first_name LIKE '$search'";
$result = mysql_query ($query);
if ($result) {
while ($row = mysql_fetch_array ($result)) {
echo "Name: {$row['name']} " .
"{$row['lname']} <br>" .
"Email: {$row['email]} <br>" .
}
}
?>
Any insight would be most appreciated.
Thank you.