You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Advantages: you can bookmark your searches, and they show up in your history, etc. (I guess this is why wordpress uses it, or maybe its just convenient, whatever).
[code]
function search() {
$this->load->helper('url'); //required for base_url()
$arr = explode('?s=', $_SERVER['REQUEST_URI']);
$searchStr = isset($arr[1]) ? addslashes(urldecode(trim($arr[1]))) : '';
echo '<form method="get" action="'. base_url() . 'blog/search/">'
."Search for phrase:<br />"
."<input type='text' name='s' value='$searchStr'>"
. "<br />"
.'<input type="submit" Search>';
/*
rest of code goes here
... find data in database and display it
*/