How to get a link in a table to another page, but after setting a custom config value

Permalink
I'm working on converting an old site to a new concrete5 site. the old site includes this piece of php:

while($line = mysql_fetch_array($result,MYSQL_ASSOC)) {
print "<tr>";
$ticketid = $line["SN"]."-A".$line["InfoSN"];
print "<td>"; print "<a href = \"showticket.php?ticket=".$ticketid."\">".$ticketid; print "</td>";
...

basically it creates a table where the ticketid is a clickable item, which then launches the page showticket.php and passes in the value.

I was thinking that instead I could create a basic "ticket" page, hidden from navigation, which each link would go to, after setting a custom value as arcanepain suggests on this post:

https://www.concrete5.org/community/forums/customizing_c5/global-val...

then on that page I do what showticket.php does in the old script, in a php block.

I'm just a bit stuck on how I can do this in the php above. Is there a way in php to basically follow this logic:

- If this item is clicked
-- store a global value
-- go to this page in the system

Thanks for any help!
Heather

HeatherMyers
 
HeatherMyers replied on at Permalink Reply
HeatherMyers
I was able to just use a relative path to the concrete page and pass in the value. I was thrown off because there's no .php extension for the concrete page, so I wasn't sure I was allowed to just pass the value (rookie issue).

Changing the table line above to:

print "<td>"; print "<a href = \"../support/support-ticket-status?ticket=".$ticketid."\">".$ticketid; print "</td>";

and then using this in a php block in support-ticket-status works:

$ticketid = $_GET['ticket'];
echo "Ticket to look up is $ticketid";

works as expected.