Welcome to Geeklog, Anonymous Saturday, October 17 2026 @ 08:46 am EDT
Geeklog Forums
phpblock_searchform
Status: offline
::Ben
Site Admin
Admin
Registered: 01/14/05
Posts: 1592
Need to display a searchform in a phpblock. Try this function:
{
global $_CONF, $LANG09;
$searchbox = "<div>";
$searchbox .= " <form method=\"get\" action=\"{$_CONF['site_url']}/search.php\">";
$searchbox .= " <div>";
$searchbox .= " <input id=\"header-textbox\" type=\"text\" name=\"query\" maxlength=\"255\" value=\"{$LANG09[10]}\" title=\"Search\" onfocus=\"if (this.value=='{$LANG09[10]}')this.value='';\" onblur=\"if(this.value=='')this.value='{$LANG09[10]}';\"" . XHTML . "><input type=\"hidden\" name=\"type\" value=\"all\"><input type=\"hidden\" name=\"mode\" value=\"search\"" . XHTML . ">";
$searchbox .= " </div>";
$searchbox .= " </form>";
$searchbox .= " </div>";
return $searchbox;
}
Ben
Text Formatted Code
function phpblock_searchform (){
global $_CONF, $LANG09;
$searchbox = "<div>";
$searchbox .= " <form method=\"get\" action=\"{$_CONF['site_url']}/search.php\">";
$searchbox .= " <div>";
$searchbox .= " <input id=\"header-textbox\" type=\"text\" name=\"query\" maxlength=\"255\" value=\"{$LANG09[10]}\" title=\"Search\" onfocus=\"if (this.value=='{$LANG09[10]}')this.value='';\" onblur=\"if(this.value=='')this.value='{$LANG09[10]}';\"" . XHTML . "><input type=\"hidden\" name=\"type\" value=\"all\"><input type=\"hidden\" name=\"mode\" value=\"search\"" . XHTML . ">";
$searchbox .= " </div>";
$searchbox .= " </form>";
$searchbox .= " </div>";
return $searchbox;
}
Ben
30
30
Quote
All times are EDT. The time is now 08:46 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content