{"id":74,"date":"2016-06-03T08:51:52","date_gmt":"2016-06-03T00:51:52","guid":{"rendered":"http:\/\/www.tra56.com\/?p=74"},"modified":"2016-06-03T08:51:52","modified_gmt":"2016-06-03T00:51:52","slug":"php-four-level-linkage","status":"publish","type":"post","link":"https:\/\/www.tra56.com\/74.html","title":{"rendered":"php\u56db\u7ea7\u8054\u52a8"},"content":{"rendered":"

\n\tphp+jQuery\u5b9e\u73b0\u7684\u56db\u7ea7\u8054\u52a8\n<\/p>\n

\n\t\u524d\u53f0\uff1a\n<\/p>\n

\n
\n
\n\n
\n
\n
\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t3\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t4\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t5\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t6\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t7\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t8\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t9\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t10\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t11\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t12\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t13\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t14\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t15\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t16\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t17\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t18\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t19\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t20\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t21\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t22\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t23\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t24\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t25\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t26\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t27\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t28\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t29\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t30\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t31\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t32\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t33\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t34\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t35\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t36\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t37\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t38\n\t\t\t\t\t\t<\/div>\n<\/td>\n
\n
\n
\n\t\t\t\t\t\t\t\t<html>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    <metahttp-equiv=\"Content-Type\"content=\"text\/html;charset=utf-8\"\/>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    <scripttype=\"text\/javascript\"src=\"jquery-1.7.1.min.js\"><\/script>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    <scripttype=\"text\/javascript\">\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t        $.post(\"bak.php\", {id:0},\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t            function(status){\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                str = '<option>\u8bf7\u9009\u62e9<\/option>';\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                for(var i=0;i<status.length;i++){\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                    str += '<optionvalue=\"'+status[i].id+'\">'+status[i].name+'<\/option>';\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                }\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t            $('select').html(str);\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t            }, \"json\");\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t        function change(obj){\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t            $(obj).nextAll().remove();\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t            $.ajax({\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                'url':'bak.php',\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                'type':'post',\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                'data':{'id':$(obj).val()},\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                'dataType':'json',\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                'success':function(status){\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                    str = '<selectonchange=\"change(this)\"><option>\u8bf7\u9009\u62e9<\/option>';\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                    for(var i=0;i<status.length;i++){\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                        str += '<optionvalue=\"'+status[i].id+'\">'+status[i].name+'<\/option>';\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                    }\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                    str += '<\/select>';\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                    $('select:last').after(str);\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t                }\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t            });\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t        }\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    <\/script>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t<\/head>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    <selectonchange=\"change(this)\">\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    <\/select>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t<\/body>\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t<\/html>\n\t\t\t\t\t\t\t<\/div>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<\/div>\n

\n\t\u540e\u53f0\uff1a\n<\/p>\n

\n
\n
\n\n
\n
\n
\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t2\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t3\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t4\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t5\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t6\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t7\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t8\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t9\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t10\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t11\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t12\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t13\n\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t14\n\t\t\t\t\t\t<\/div>\n<\/td>\n
\n
\n
\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    $id= isset($_POST['id']) ?$_POST['id'] : 0 ;\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    $conn= mysql_connect('localhost','root','');\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    mysql_select_db('mogu');\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    $result= mysql_query(\"set names 'utf8'\");\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    $sql=\"select * from city where upid=\".$id;\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    $result= mysql_query($sql);\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    while($rs= mysql_fetch_assoc($result)){\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t        $arr[] =$rs;\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    }\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t    echojson_encode($arr);\n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t<\/div>\n
\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<\/div>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

php+jQuery\u5b9e\u73b0\u7684\u56db\u7ea7\u8054\u52a8 \u524d\u53f0\uff1a 1 2 3 4 5 6 7 8 9 10 11 12 13 14 […]<\/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-74","post","type-post","status-publish","format-standard","hentry","category-html"],"_links":{"self":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/74"}],"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=74"}],"version-history":[{"count":1,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/74\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}