求按照CI架構分離html頁面

來源:互聯網
上載者:User
在網上找了一個移序的功能,但是代碼是php、mysql、html混搭的,現在用的是CI架構,剛接觸架構不久,不會分離,請各位幫忙照著CI架構的模式分離這個頁面
資料庫頁面:class_moder.php
處理頁面:admin.php
html頁面:sort.html

    實現新聞的上移下移功能        query("select * from `article` where `weight` > '$_GET[weight]' order by `weight` asc limit 1");         if($conn->db_num_rows(query)>0){             $rows=$conn->fetch_array($query);             $conn->query("update `article` set `weight`='$rows[weight]' where `weight`='$_GET[weight]'");             $conn->query("update `article` set `weight`='$_GET[weight]' where `ID`='$rows[ID]'");         }else{             echo "";         }     }else if($_GET["move"]=="down"){         //擷取下一條新聞資訊         $query=$conn->query("select * from `article` where `weight` < '$_GET[weight]' order by `weight` desc limit 1");         if($conn->db_num_rows(query)>0){             $rows=$conn->fetch_array($query);             $conn->query("update `article` set `weight`='$rows[weight]' where `weight`='$_GET[weight]'");             $conn->query("update `article` set `weight`='$_GET[weight]' where `ID`='$rows[ID]'");         }else{             echo "";         }     } } ?>  query("select * from `article` order by `weight` desc"); if($conn->db_num_rows($query)>0){ while($rows=$conn->fetch_array($query)){     $aid[].=$rows["ID"]; ?>         
文章上下移動
ID標題移動
?weight=&move=up">上移/?weight=&move=down">下移


回複討論(解決方案)

這個……CI的官方文檔裡有完整樣本看過就知道怎麼分了

看過文檔,知道怎麼弄了

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.