Header( 'Content-type: text/html; charset=UTF-8' ); |
|
$w =isSet( $_REQUEST [ 'w' ]) ? AddsLashes ( $_REQUEST [ 'w' ]) : '' ; |
//獲取參數w的值,w來自于rewrite規則文件.htaccess |
|
$w =(Trim( $w )== '' ) ? 'index' : $w ; |
//如果參數w的值為空,則訪問默認的index方法 |
|
IF(! is_callable ( $w )) { |
//如果$w所屬的function不存在 |
|
Exit ( 'Error:' . __LINE__ . ',參數錯誤!' ); |
//拋出錯誤 |
} |
$w (); |
//調用$w名稱對應的function,例如:http://URL/hello會調用hello()這個function |
|
//自定義方法(可自由擴展) |
Function hello(){ |
Echo 'Hello World!' ; |
} |
|
Function index(){ |
Echo '此框架由Seven編寫,來自QQ群:223494678' ; |
} |