TRACKMIXERS
Member
I am trying to use a php search script on a page.
I can echo a simple "hello world" fine.
I get this error though when trying my script, any help is appreciated.
Server Error
Undefined index: kw
My plugin.php file for callback looks like this:
I can echo a simple "hello world" fine.
I get this error though when trying my script, any help is appreciated.
Server Error
Undefined index: kw
- XenForo_Application::handlePhpError() in XenForo/Pages/test.php at line 2
- require() in XenForo/Pages/plugin.php at line 7
- XenForo_Pages_plugin::includePhpFile()
- call_user_func_array() in XenForo/ControllerPublic/Page.php at line 46
- XenForo_ControllerPublic_Page->actionIndex() in XenForo/FrontController.php at line 310
- XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
- XenForo_FrontController->run() in /home/xxxxxr/public_html/testxf/index.php at line 13
PHP:
<?php
$search = $_POST["kw"];
if ($search == '') // If value does not equal anything
{
$search = "media";
} else { // if value is not empty
;
}
?>
My plugin.php file for callback looks like this:
PHP:
<?php
class XenForo_Pages_plugin
{
public static function includePhpFile(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
ob_start();
require('library/XenForo/Pages/test.php');
$myContent = ob_get_contents();
ob_end_clean();
$params = array(
'myContent' => $myContent
);
$response->params = array_merge(
$response->params,
$params
);
}
}