I finally got my search page working however the result are then displayed on this blank page.
what im trying to achieve is to display the results on my searchindex.php
i can do a
include 'searchindex.php';
just before the
do
statement and the results would be displayed on that page. However i use css to display ever asspect of my page. and the results wouldnt be positioned correctly. i can add whats needed to my style.css however this page being fully php how do i wrap a div class around it
so when result is shown it will dispaly on the right page in the right position
Code: Select all
<?php
include 'Connect.php';
if(!isset($_GET[submit]))
{
// Show the form
include 'searchindex.php';
exit;
}
else
{
$result = mysql_query ("SELECT * FROM members WHERE username LIKE '%$searchone%' ");
PRINT "<b>You searched for:</b> ";
PRINT "$searchone";
print ("<br>");
if ($row = mysql_fetch_array($result))
{
do
{
PRINT "<b>User Name: </b> ";
print $row["username"];
print (" ");
print ("<br>");
PRINT "<b>Location: </b> ";
print $row["location"];
print ("<p>");
PRINT "<b>Date of Birth: </b> ";
print $row["dob"];
print ("<p>");
}
while($row = mysql_fetch_array($result));
}
else {print "Sorry, no records were found!";}
}
?>