<?php
session_start();

if( !isset($_POST['keyword']) || !( $static_str_search_keyword = trim(strip_tags($_POST['keyword'])) ) )
	exit(json_encode(array('ErrCode'=>-1, 'ErrMessage'=>'請輸入您要搜尋之商品關鍵字', 'RedirectURL'=>'')));
else if( strlen($static_str_search_keyword) <= 1 )
	exit(json_encode(array('ErrCode'=>-1, 'ErrMessage'=>'關鍵字太短，請多輸入一些關鍵字以便精確搜尋', 'RedirectURL'=>'')));

$_SESSION['search_keyword'] = $static_str_search_keyword;

exit(json_encode(array('ErrCode'=>1, 'ErrMessage'=>'', 'RedirectURL'=>'search_news.php')));
?>
