Closed joshobrienau closed 5 years ago
Hi there, have a look at this example to see how to use GET or POST parameters to make your pass dynamic: https://github.com/tschoffelen/php-pkpass/blob/master/examples/starbucks_sample/index.php#L29
This example uses $_POST
, but it is of course easy enough to replace that by $_GET
to access the URL parameters.
Cool thanks for that, that sort of covers part of what I'm wanting to do.
However I was more wanting the URL parameters to pre-fill the text input fields, so say a user wanted to edit their pass to update their name for example. So sending the data in the URL would pre-fill the text fields, but still allow them to edit any of the pre-filled fields before creating the pass?
Also one other thing I've not been able to solve for, is using hyperlinks for the backfields on the back of the pass. Whenever I add hyperlinks the PHP won't load, it just crashes.
I'm wanting to add the hyperlink as an option on the back of the pass as "Update Pass" option, which takes them to the above mentioned dynamic URL with the variable parameters.
Both of these things seem more like general PHP questions than anything related to this library, so it might be better to just do some googling or search on Stack Overflow.
Yeah was more so if someone had already resolved these issues and was planning a pull, especially around hyperlinks in the PHP code, which are outlined in Apple's pass developer documenation, if any of these have spaces or special characters being passed through variables, the PHP crashes.
I've made the changes to the PHP code to allow both variables to auto generate and populate text fields, so I'll close off this issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Currently variable URL strings are ignored with PKPass, has anyone resolved this? So that URL variables can be passed to make generation of passes easy for end users.
For example: www.example.com/pass/?name=John&barcode=12345
Which can then fill the required fields to generate dynamic passes automatically.