0

i would like some help with making my search box work on my forum, at the moment when u type anything in it just refreshes the page and the same page is shown. I want it to show the thread if some types in say 'hello' it should show threads that start with hello below is my code if anyone1 can help me adjust the code that couwld be great!!. thanks

<?
// Command_BlogIndex.php

//############################################################################
// SearchVenueCommand class
//############################################################################

require_once("ManagerMessage.php"); 


class Command_BlogIndex extends Command
{


 //############################################################################
 // doExecute
 //############################################################################ 
 function doExecute(Request $request)
 {
 // Create manager object
 $manager = new ManagerMessage();

 // Get data from database object
 $data = $manager->getAllMessages();
 
 // Include view
 include("views/index.php");
 }
} 
?>
2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by raf11
0

i have been trying and was stuck thats y i posted on the forum for some help not to be told to try again, advice in the right direction would be better or some suggestion on what i neeed to add to the code to make it work, im not asking for u to provide me with a full blown code but to tell me where to adjust the code or what to add to it so i can make it work

0

I was simply stating that you have not included the code that needs to be posted to help you. You obviously have the code that runs with the class. Otherwise the class is meaningless. If you misread my reply, I apologise, but it still doesn't change the reality of the situation. Which piece of code is failing? If you don't post it, we can't help. The code as you've posted looks like some random piece of object-orientated stuff. So my 'try again' comment simply means, post the right piece of code. Don't be so quick to take offence.

0

been trying to get this right but still getting errors pls could u tell me where i am going wrong here im gettin this error Parse error: syntax error, unexpected T_INCLUDE in /home/0/092/public_html/Command_BlogIndex.php on line 37

<?
// Command_BlogIndex.php

//############################################################################
// SearchVenueCommand class
//############################################################################

require_once("ManagerMessage.php"); 


class Command_BlogIndex extends Command
{


// doExecute

function doExecute(Request $request)
{
// Create manager object
$manager = new ManagerMessage();

// Get data from database object
$title = $request->getProperty('title');

if($title == "")
{ 
$data = $manager->getAllMessages(); 
}

else

{
$data = $manager-> searchMessages() 
 

// Include view
  include("views/index.php");
}
}

?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.