<?php /** * 主入口文件 * @author lixin <*****@*****.**> * @version */ include 'Common/common.php'; //增加include文件夹 //set_include_path(get_include_path().';./Lib'); //创建get参数 $GLOBALS['safeGetParam'] = createGetParams(); //将安全get参数装载到全局数组 $GLOBALS['safePostParam'] = createPostParams(); //将安全get参数装载到全局数组 //注册自动加载类函数,__autoload与 smarty3 有冲突 spl_autoload_register('classLoader'); //加载控制器 $module = safeStr($GLOBALS['safeGetParam']['module']); $action = safeStr($GLOBALS['safeGetParam']['action']); $module = empty($module) ? 'IndexAction' : ucfirst(strtolower($module)) . 'Action'; $action = empty($action) ? 'index' : strtolower($action); $__m = new $module(); $__m->{$action}();
/** * 处理http get 数据 * @param string $table 表名 */ function createGetParams() { if (URL_MODE === 1) { if (!empty($_SERVER['PATH_INFO'])) { $pathInfo = trim(trim($_SERVER['PATH_INFO']), '/'); $paramArray = array_reverse(explode('/', $pathInfo)); //获取控制器参数 $safeParam['module'] = safeStr(array_pop($paramArray)); $safeParam['action'] = safeStr(array_pop($paramArray)); //生成GET数组其他参数 while (!empty($paramArray)) { $key = safeStr(array_pop($paramArray)); $value = safeStr(array_pop($paramArray)); $safeParam[$key] = $value; } } } foreach ($_GET as $key => $value) { $safeParam[$key] = safeStr($value); } return $safeParam; }
if (!isset($p_xDim)){ $p_xDim = 1; } if (!isset($p_w2n)){ $p_w2n = 3; } if (!isset($p_charHeight)){ $p_charHeight = 50; } $p_charGap = $p_xDim; $msg=""; if (!safeStr($p_bcType, $p_text)){ $msg = "Non-Valid characters inside string"; } $dest = "wrapper.php?p_bcType=$p_bcType&p_text=$p_textEnc" . "&p_xDim=$p_xDim&p_w2n=$p_w2n&p_charGap=$p_charGap&p_invert=$p_invert&p_charHeight=$p_charHeight" . "&p_type=$p_type&p_label=$p_label&p_rotAngle=$p_rotAngle&p_checkDigit=$p_checkDigit" ?> <HTML> <HEAD> <TITLE>Barcode Result Page V 1.1 - Cachique</TITLE> </HEAD> <BODY>