-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebeducation.php
44 lines (39 loc) · 1019 Bytes
/
webeducation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
if(!defined('DIRECTORY_SEPATRATOR')) define('DIRECTORY_SEPATRATOR','/');
ob_start();
function ActionLink($action='',$model='',$opts=null,$echo=true){
$result = array();
$result[] = 'model='.urlencode($model);
$result[] = 'action='.urlencode($action);
if(!empty($opts)){
foreach($opts as $k => $v){
$result[] = $k.'='.urlencode($v);
}
}
if($echo)
echo '?'.implode('&',$result);
return '?'.implode('&',$result);
}
function Render(){
$params = func_get_args();
if(empty($params))return;
$params = array_reverse($params);
include './cgi/'.implode(DIRECTORY_SEPATRATOR,$params).'.php';
}
$model="index";
$action="index";
if(array_key_exists('model',$_GET)){
$model=$_GET['model'];
}
if(array_key_exists('action',$_GET)){
$action=$_GET['action'];
}
define('Model',$model);
define('Action',$action);
define('Execute',true);
if(file_exists("./cgi/$model/$action.php")){
require "./cgi/$model/$action.php";
}else{
require "./cgi/index/index.php";
}
?>