Nope - it just displays the entire table... not filtering...
Here's my entire PHP code:
PHP Code:
<?php
// All Code (C) 2009 X96 Web Design
if(isset($_GET['n'])) {
$con = mysql_connect("localhost","myuser","mypass");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("index", $con);
$get = $_GET['n'];
$results = mysql_query("SELECT * FROM webindex");
$topic = mysql_query("SELECT `keywords` FROM webindex WHERE keywords='$get'");
while($row = mysql_fetch_array($results)) {
if(isset($_GET['n'])){
echo '<h2>Showing Results for <em>'.$_GET['n'].'</em></h2>';
echo '<p class="result"><a href="'.$row['url'].'" target="shared">'.$row['title'].'</a><br/><span><span>Indexed on '.$row['added'].'</span><br/>'.$row['description'].'</span><br/><span class="url">'.$row['url'].'</span></p>';
}
else {
echo '<h1>No Pages Found!</h1><p>No results could be found for the keyword(s) you entered.</p>';
}
}
mysql_close($con);
}
elseif(isset($_GET['n']) == null) {
echo 'Please enter a keyword into the search form.';
}
else {
echo 'Hacker.';
}
No matter what keywords are entered, it still displays all of the table data...
Bookmarks