{"id":111,"date":"2017-01-02T09:39:37","date_gmt":"2017-01-02T01:39:37","guid":{"rendered":"http:\/\/www.tra56.com\/?p=111"},"modified":"2017-01-02T09:39:37","modified_gmt":"2017-01-02T01:39:37","slug":"php-using-canonical-judgments-is-digital","status":"publish","type":"post","link":"https:\/\/www.tra56.com\/111.html","title":{"rendered":"php\u7528\u6b63\u5219\u5224\u65ad\u662f\u5426\u4e3a\u6570\u5b57"},"content":{"rendered":"

\n\t\u524d\u4e24\u5929\u670b\u53cb\u7684\u4e00\u4e2a\u7f51\u7ad9\u4e0a\u6709\u4eba\u5229\u7528php\u6ce8\u5165\u63d0\u4ea4flash\u6e38\u620f\u5206\u6570\uff0c\u540e\u6765\u627e\u539f\u56e0\u624d\u53d1\u73b0\u662f\u6709\u4e00\u4f4d\u53c2\u6570\u6ca1\u6709\u505a\u6570\u5b57\u5224\u65ad\u5bfc\u81f4\u3002\n<\/p>\n

\n\t\u672c\u6765\u4fdd\u5b58\u6e38\u620f\u5206\u6570\u662f game.php?ac=save&fgid=1\u8fd9\u4e2a\u5f62\u5f0f\u6765\u5b9e\u73b0\uff0c\u5728php\u7f51\u9875\u91cc\u9762fgid\u76f4\u63a5\u8c03\u7528\uff0c\u6ca1\u6709\u505a\u4efb\u4f55\u7684\u8fc7\u6ee4\u3002\u5f88\u591a\u4eba\u5229\u7528\u5728fgid=1\u540e\u9762\u52a0\u4e00\u4e2a\u5b57\u6bcd(fgid=1a)\uff0c\u6765\u5b9e\u73b0\u4e00\u4e9b\u975e\u6cd5\u64cd\u4f5c\u3002\n<\/p>\n

\n\t\u5047\u5982  gamlist table \u91cc\u9762\u6709\u4e00\u4e2a\u6e38\u620f  fgid\u4e3a102
\nselect gname from gamelist where fgid=\u2019102\u2032;
\nselect gname from gamelist where fgid=\u2019102a\u2019;
\n\u8fd9\u6837\u90fd\u53ef\u4ee5\u6210\u529f\u7684\u627e\u5230\u6e38\u620f\u540d\u5b57gname\uff0c\u8fd9\u5c31\u7ed9\u5f88\u591a\u4eba\u63d0\u4f9b\u4e86\u53ef\u4e58\u4e4b\u673a\n<\/p>\n

\n\t\u5efa\u8bae\u5927\u5bb6\u5bf9\u5173\u952e\u7684\u53c2\u6570\u5fc5\u987b\u505a\u8fc7\u6ee4\u3002\u5982\u6570\u5b57\u6b63\u5219\u8fc7\u6ee4[code]if(preg_match(\"\/^\\d*$\/\",$fgid))    echo('\u662f\u6570\u5b57');
\nelse   echo('\u4e0d\u662f\u6570\u5b57');[\/code]\u6216\u8005\u7528\u51fd\u6570[code]if(is_numeric($fgid)) echo('\u662f\u6570\u5b57');
\nelse echo('\u4e0d\u662f\u6570\u5b57');[\/code]\u8fd9\u4e24\u79cd\u65b9\u6cd5\u7684\u533a\u522b\u662f  is_numeric\u5c0f\u6570\u4e5f\u4f1a\u8ba4\u4e3a\u662f\u6570\u5b57\uff0c\u800c\u524d\u9762\u6b63\u5219\u4f1a\u628a\u5c0f\u6570\u70b9\u5f53\u4f5c\u5b57\u7b26\u3002\n<\/p>\n

\n\t\u9644\u4e00\u4e9b\u5e38\u7528\u7684\u6b63\u5219\u8fd0\u7b97\uff1a\n<\/p>\n

\n\t\u9a8c\u8bc1\u6570\u5b57\uff1a^[0-9]*$
\n\u9a8c\u8bc1n\u4f4d\u7684\u6570\u5b57\uff1a^\\d{n}$
\n\u9a8c\u8bc1\u81f3\u5c11n\u4f4d\u6570\u5b57\uff1a^\\d{n,}$
\n\u9a8c\u8bc1m-n\u4f4d\u7684\u6570\u5b57\uff1a^\\d{m,n}$
\n\u9a8c\u8bc1\u96f6\u548c\u975e\u96f6\u5f00\u5934\u7684\u6570\u5b57\uff1a^(0|[1-9][0-9]*)$
\n\u9a8c\u8bc1\u6709\u4e24\u4f4d\u5c0f\u6570\u7684\u6b63\u5b9e\u6570\uff1a^[0-9]+(.[0-9]{2})?$
\n\u9a8c\u8bc1\u67091-3\u4f4d\u5c0f\u6570\u7684\u6b63\u5b9e\u6570\uff1a^[0-9]+(.[0-9]{1,3})?$
\n\u9a8c\u8bc1\u975e\u96f6\u7684\u6b63\u6574\u6570\uff1a^\\+?[1-9][0-9]*$
\n\u9a8c\u8bc1\u975e\u96f6\u7684\u8d1f\u6574\u6570\uff1a^\\-[1-9][0-9]*$
\n\u9a8c\u8bc1\u975e\u8d1f\u6574\u6570\uff08\u6b63\u6574\u6570 + 0\uff09  ^\\d+$
\n\u9a8c\u8bc1\u975e\u6b63\u6574\u6570\uff08\u8d1f\u6574\u6570 + 0\uff09  ^((-\\d+)|(0+))$
\n\u9a8c\u8bc1\u957f\u5ea6\u4e3a3\u7684\u5b57\u7b26\uff1a^.{3}$
\n\u9a8c\u8bc1\u753126\u4e2a\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\uff1a^[A-Za-z]+$
\n\u9a8c\u8bc1\u753126\u4e2a\u5927\u5199\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\uff1a^[A-Z]+$
\n\u9a8c\u8bc1\u753126\u4e2a\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\uff1a^[a-z]+$
\n\u9a8c\u8bc1\u7531\u6570\u5b57\u548c26\u4e2a\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\uff1a^[A-Za-z0-9]+$
\n\u9a8c\u8bc1\u7531\u6570\u5b57\u300126\u4e2a\u82f1\u6587\u5b57\u6bcd\u6216\u8005\u4e0b\u5212\u7ebf\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\uff1a^\\w+$
\n\u9a8c\u8bc1\u7528\u6237\u5bc6\u7801:^[a-zA-Z]\\w{5,17}$ \u6b63\u786e\u683c\u5f0f\u4e3a\uff1a\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u957f\u5ea6\u57286-18\u4e4b\u95f4\uff0c\u53ea\u80fd\u5305\u542b\u5b57\u7b26\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf\u3002
\n\u9a8c\u8bc1\u662f\u5426\u542b\u6709 ^%&\u2018,;=?$\\\u201d \u7b49\u5b57\u7b26\uff1a[^%&\u2018,;=?$\\x22]+
\n\u9a8c\u8bc1\u6c49\u5b57\uff1a^[\\u4e00-\\u9fa5],{0,}$
\n\u9a8c\u8bc1Email\u5730\u5740\uff1a^\\w+[-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$
\n\u9a8c\u8bc1InternetURL\uff1a^http:\/\/([\\w-]+\\.)+[\\w-]+(\/[\\w-.\/?%&=]*)?$ \uff1b^[a-zA-z]+:\/\/(w+(-w+)*)(.(w+(-w+)*))*(?S*)?$
\n\u9a8c\u8bc1\u7535\u8bdd\u53f7\u7801\uff1a^(\\(\\d{3,4}\\)|\\d{3,4}-)?\\d{7,8}$\uff1a\u2013\u6b63\u786e\u683c\u5f0f\u4e3a\uff1aXXXX-XXXXXXX\uff0cXXXX-XXXXXXXX\uff0cXXX-XXXXXXX\uff0cXXX-XXXXXXXX\uff0cXXXXXXX\uff0cXXXXXXXX\u3002
\n\u9a8c\u8bc1\u8eab\u4efd\u8bc1\u53f7\uff0815\u4f4d\u621618\u4f4d\u6570\u5b57\uff09\uff1a^\\d{15}|\\d{}18$
\n\u9a8c\u8bc1\u4e00\u5e74\u768412\u4e2a\u6708\uff1a^(0?[1-9]|1[0-2])$ \u6b63\u786e\u683c\u5f0f\u4e3a\uff1a\u201c01\u201d-\u201c09\u201d\u548c\u201c1\u201d\u201c12\u201d
\n\u9a8c\u8bc1\u4e00\u4e2a\u6708\u768431\u5929\uff1a^((0?[1-9])|((1|2)[0-9])|30|31)$    \u6b63\u786e\u683c\u5f0f\u4e3a\uff1a01\u300109\u548c1\u300131\u3002
\n\u6574\u6570\uff1a^-?\\d+$
\n\u975e\u8d1f\u6d6e\u70b9\u6570\uff08\u6b63\u6d6e\u70b9\u6570 + 0\uff09\uff1a^\\d+(\\.\\d+)?$
\n\u6b63\u6d6e\u70b9\u6570   ^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$
\n\u975e\u6b63\u6d6e\u70b9\u6570\uff08\u8d1f\u6d6e\u70b9\u6570 + 0\uff09 ^((-\\d+(\\.\\d+)?)|(0+(\\.0+)?))$
\n\u8d1f\u6d6e\u70b9\u6570  ^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*)))$
\n\u6d6e\u70b9\u6570  ^(-?\\d+)(\\.\\d+)?<\/p>\n","protected":false},"excerpt":{"rendered":"

\u524d\u4e24\u5929\u670b\u53cb\u7684\u4e00\u4e2a\u7f51\u7ad9\u4e0a\u6709\u4eba\u5229\u7528php\u6ce8\u5165\u63d0\u4ea4flash\u6e38\u620f\u5206\u6570\uff0c\u540e\u6765\u627e\u539f\u56e0\u624d\u53d1\u73b0\u662f\u6709\u4e00\u4f4d\u53c2\u6570\u6ca1\u6709\u505a\u6570\u5b57\u5224\u65ad\u5bfc\u81f4 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/111"}],"collection":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":1,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":112,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/111\/revisions\/112"}],"wp:attachment":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}