0

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.

eleven0
  • 263
  • 6
  • 13
  • 1
    What about adding another parameter to the link and thus to the $_GET, like `index.php?d=singlerequests&id=1` and `ViewSingleRequests($_GET['id']);` Don't forget to check and sanitize input! – ZorgoZ Oct 13 '18 at 16:39
  • Thank you ZorgoZ, that worked! I will work on sanitizing the input. – eleven0 Oct 20 '18 at 03:18

0 Answers0