⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchresults.php

📁 Professional PHP5 code for this book
💻 PHP
字号:
<?require_once("constants.phpm");require_once("request.phpm");require_once("constraint.phpm");require_once("constraintfailure.phpm");$strTemplateFile = "searchresults.phtml";$displayHash = Array();$objRequest = new request();$objRequest->SetRedirectOnConstraintFailure(true);$objConstraint = new constraint(CT_MINLENGTH, "3");$objRequest->AddConstraint("typeOfSteak", VERB_METHOD_GET, $objConstraint);$objConstraint = new constraint(CT_MAXLENGTH, "12");$objRequest->AddConstraint("typeOfSteak", VERB_METHOD_GET, $objConstraint);$objConstraint = new constraint(CT_PERMITTEDCHARACTERS, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");$objRequest->AddConstraint("typeOfSteak", VERB_METHOD_GET, $objConstraint);$objRequest->SetConstraintFailureDefaultRedirectTargetURL("/search.php");$objRequest->TestConstraints();# If we've got this far, tests have been passed - perform the search.$displayHash["RESULTS"] = Array();$arSteaks = array("fillet", "rump", "sirloin", "burnt");for ($i=0; $i<=sizeof($arSteaks)-1; $i++) {  if (!(strpos(trim(strtolower($arSteaks[$i])), strtolower(trim($objRequest->GetParameterValue("typeOfSteak")))) === false)) {    array_push($displayHash["RESULTS"], $arSteaks[$i]);  };};require_once($strTemplateFile);exit(0);?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -