Em đang cần tìm code gần giống như http://tytalk.net
ví dụ: http://tytalk.net/?download ra nội dung trang download
còn http://tytalk.net/?help thì ra nội dung trang hướng dẫn.
ai có code dạng này ko giúp em với nhé, thank nhiều
Nếu đây là lần đầu tiên bạn tham gia diễn đàn, xin mời bạn xem phần Hỏi/Ðáp để biết cách dùng diễn đàn. Để có thể tham gia thảo luận bạn phải đăng ký làm thành viên, click vào đây để đăng ký.
Em đang cần tìm code gần giống như http://tytalk.net
ví dụ: http://tytalk.net/?download ra nội dung trang download
còn http://tytalk.net/?help thì ra nội dung trang hướng dẫn.
ai có code dạng này ko giúp em với nhé, thank nhiều
Cái này hôm trước hỏi bên FCVN rồi mà bác
Ví dụ nha:
http://localhost/luubut/index.php?action=sign
PHP Code:
if ( !empty( $_GET ) ) {
if ( isset( $_GET[ "action" ] ) ) $action = $_GET[ "action" ];
if ( isset( $_GET[ "page" ] ) ) $page = $_GET[ "page" ];
}
else if ( !empty( $HTTP_GET_VARS ) ) {
if ( isset( $HTTP_GET_VARS[ "action" ] ) ) $action = $HTTP_GET_VARS[ "action" ];
if ( isset( $HTTP_GET_VARS[ "page" ] ) ) $page = $HTTP_GET_VARS[ "page" ];
}
if ( isset( $_POST["action"] ) ) $action = $_POST[ "action" ];
else if ( isset( $HTTP_POST_VARS[ "action" ] ) ) $action = $_POST[ "action" ];
# Make sure we have page number.
if ( !isset( $page ) or $page == 0 ) $page = 1;
session_start();
# Show sign form
if ( $action == "sign") {
/* New in version 0.6.1
* Now we set a session var if user has visited our sign page.
*/
//session_start();
$userIP = $_SERVER[ "REMOTE_ADDR" ];
$pathTranslated = $_SERVER[ "PATH_TRANSLATED" ];
$_SESSION[ "SIGN_PAGE_VISITED" ] = true;
$_SESSION[ "USER_IP" ] = $userIP;
$_SESSION[ "KEY" ] = md5( $pathTranslated );
# Get the signing form template
$signTemplate = gbLoadTemplate( "temp_sign.html" );
# New in v0.7
# Needed since temp_sign.html now uses GB_TAGS as values for
# input fields.
#NEW IP
$signTemplate = gbSwapEntryGBTags( $signTemplate, -1, "", -1, "", "http://", "", "", false );
# Swap global GB_TAGS
$signTemplate = gbSwapGlobalGBTags( $signTemplate );
// Confirmation code
if ( $cfgEnableConfirmationCode ) {
$signTemplate = gbSwapConfirmCode( $signTemplate );
}
# Show sign form
echo $signTemplate;
}
Có thể dùng
switch ($bien){
Case gia_tri 1:
doan_lenh_1;
Case gia_tri 2:
doan_lenh_2;
Case gia_tri n:
doan_lenh_n;
default:
doan_lenh_khac;
}
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks