Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Process _GET variable

first-time plugins

Started by Steven 2 years ago · 0 replies · 35 views
2 years ago

I'm porting some online store code (written in raw HTML/PHP/mySQL) to Grav. The credit card processor sends the user to https://www.company.com/store/thanks?orderId=123.

That should invoke (via a plugin, I assume), a call to a PHP function that does stuff with the orderId like pull the order from the database, call the processor via curl to get the payment status, update the database, and eventually display a "Thank You" page to the user.

What I don't yet understand is how to invoke my plugin from the "thanks" page, and pass it the GET variable. Should the plugin function directly access the $_GET variable?

I still haven't figured out how to use a plugin on a particular page, because I don't need to invoke the plugin on all my pages, just the store pages.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 9 hours ago
Support · by Anna, 3 days ago
2 59 12 hours ago
Support · by Justin Young, 13 hours ago
1 30 12 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago