根據單選按鈕判斷使用者型別

2021-08-03 19:41:34 字數 455 閱讀 8705

頁面布局:

使用者登入  

專家登入   

登入

功能需求:根據單選按鈕判斷使用者型別,設計不同的提交方式

操作過程:

$(function()

if ($("#password").val() == "")

var usertype = $("input:radio[name='radio']:checked").val();

//判斷登入使用者型別,普通使用者執行以下提交

if(usertype == 'user'),function(data)else

});return false;

}//專家使用者執行以下提交

if(usertype == 'expert'),function(data)else

});return false;}})

});

撒旦

根據檔案內容判斷檔案型別

判斷檔案型別,一般情況下可以根據檔案字尾約定,使用相應的處理方式處理。或者基於檔案magic number 檔案的前512個bytes 對檔案型別進行判斷,c c 可以通過libmagic處理判斷檔案型別,下面是stackoverflow上使用libmagic的實現 include include ...

判斷使用者終端型別 php程式

php簡單判斷iphone ipad android及pc裝置的型別 將使用windows系統的裝置定為pc 原理是判斷瀏覽器提交的user agent,如下 獲取user agent 分析資料 is pc strpos agent,windows nt true false is iphone s...

PHP根據訪問使用者IP判斷所屬區域資訊

根據訪問使用者ip判斷所屬區域資訊 author flyer0126 since 2012 07 09 獲取使用者端ip 利用 介面根據ip查詢所在區域資訊 res1 file get contents res1 json decode res1 print r res1 示例輸出結果如下 stdc...