Help!
MY HTML
<form method="post" action="index.php?page=pages&act=search_do" class="search"> <p><input name="search" class="textbox" type="text" /> <input name="search" class="searchbutton" value="Search" type="submit" /></p> </form>
MY PHP
<a href="searchresults"></a>
<h1>Search Results</h1>
<p>
<codeblock>
<?php
$search = htmlspecialchars($_POST["search"]);
$result = mysql_query("SELECT * FROM `articles` WHERE subject LIKE '%$search%' AND content LIKE '%$search%' AND postdate LIKE '%$search%'")or die(mysql_error());
if ($search = ""){
echo 'Please enter a term to search';
}
elseif (mysql_num_rows($result) == "0") {
echo 'Nothing was found. Try entering another search term.';
}else{
while($row = mysql_fetch_array($result)){
$aid = $row['aid'];
$subject = $row['subject'];
$postdate = $row['postdate'];
$content = bbcode($row['content']);
echo "$subject - <a href=\"#\">view</a> | $postdate <br />
";
}
}
?>
</codeblock>
</p>
Anyone have a clue? And yes their on different pages.
Edited by Braunson, 28 March 2007 - 01:49 PM.
