PHP - Switch case & _GET and Dynamic URL creation

2019-09-02 14:48发布

问题:

What I have in my index page:

    if(isset($_GET['d']) && $_GET['d']!="" ){
        switch ($_GET['d']) {
            case 'singlerequests':
            ViewSingleRequests();
            break;

    }

I have a sidebar menu in which I call cases like index.php?d=singlerequests, this saves me from creating a new php file every link i want to have in the file.

What I want to do: I created a page, in which I am listing multiple rows of date. My data row has multiple columns so instead of showing all data with all columns on that page, I will only have a summary table and a "View More" link next to each row, in which they view the full data on another page. (something like below)

Row Name | View More Link
Row Name | View More Link
Row Name | View More Link

I can retrieve the unique ID for that row in my code but i dont know how I can pass that data(identifier) through above switch case to another function, where i will display all columns of that row to user? If it's not possible that way, how can i do it in a different way?

Thanks.