Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $vung = $_GET["vung"];
- $limit = $_GET["limit"];
- $mangxoso = array(
- "xo-so-binh-duong",
- "xo-so-tp-ho-chi-minh",
- "xo-so-binh-thuan",
- "xo-so-ca-mau",
- "xo-so-dong-thap",
- "xo-so-bac-lieu",
- "xo-so-ben-tre",
- "xo-so-dong-nai",
- "xo-so-soc-trang",
- "xo-so-can-tho",
- "xo-so-an-giang",
- "xo-so-vung-tau",
- "xo-so-binh-phuoc",
- "xo-so-hau-giang",
- "xo-so-kien-giang",
- "xo-so-lam-dong",
- "xo-so-tay-ninh",
- "xo-so-tra-vinh",
- "xo-so-vinh-long",
- "xo-so-tien-giang",
- "xo-so-long-an",
- "xo-so-da-nang",
- "xo-so-quang-nam",
- "xo-so-khanh-hoa",
- "xo-so-dac-lac",
- "xo-so-binh-dinh",
- "xo-so-dac-nong",
- "xo-so-gia-lai",
- "xo-so-kon-tum",
- "xo-so-ninh-thuan",
- "xo-so-phu-yen",
- "xo-so-quang-binh",
- "xo-so-quang-ngai",
- "xo-so-quang-tri",
- "xo-so-thua-thien-hue",
- "xo-so-mien-bac"
- );
- function XuLyChuoi($strInput)
- {
- $xuly = $strInput;
- $xuly = str_replace("-", "", $xuly);
- $xuly = str_replace(" ", "", $xuly);
- $xuly = substr($xuly, 4);
- return $xuly;
- }
- ;
- function HienThi($vung, $limit)
- {
- //$xuly = $strInput;
- $conn = mysql_connect("localhost", "root", "admin") or die("can't connect this database");
- mysql_select_db("appxoso", $conn);
- //$limit = 5;
- $sql = "SELECT * FROM $vung ORDER BY pid DESC LIMIT $limit";
- $result = mysql_query($sql);
- $stt = 0;
- while ($row = mysql_fetch_array($result)) {
- $xulykq = str_replace(" ", "", $row["ketqua"]);
- $xulytg = str_replace(" ", "", $row["thoigian"]);
- $stt++;
- echo "$stt - $xulykq - $xulytg";
- echo "<br>";
- }
- }
- ;
- for ($i = 0; $i < count($mangxoso); $i++) {
- //$vungmang = XuLyChuoi($mangxoso[$i]);
- if (strcasecmp($mangxoso[$i], $vung) == 0) {
- HienThi(str_replace("-", "", $mangxoso[$i]), $limit);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment