douwo1862 2013-11-25 17:20
浏览 267
已采纳

如何使用html和ajax在另一个页面中发送数据

i'm starting delevope android application with phonegap as you may know i can't use php file in front-end of my app, so i have a list that create dynamic when user click on the each link go to the singers_category.html and base of the the $genre_id i want load group of singers on singers_category.html; i'm try using QueryString but i'm think i can't using QueryString in html page; so this is my code of php handler: (i'm using switch case to using multiple handler in one page)

<?php
include('db_inc.php');
$functionId=$_GET['functionId'];
echo "$functionId <br>";
switch($functionId){
    case "":
    $singer_id =$_POST['last_items'];
    $result = $connection->query("SELECT * from genre")or die($connection->error);
        while($row = $result->fetch_object()){
            $genre_name = $row->genre_name;
            $genre_id = $row->genre_id;
            echo "<li><a href='singers_category.html?$genre_id >$genre_name</li>";
            }
            $connection->close;
            break;
    }


?>

my question is:how to access specific $genre_id with ajax and html and one php handler in singers_category.html

  • 写回答

3条回答 默认 最新

  • dongtan8979 2013-11-29 10:47
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?